Results 1 to 5 of 5

Thread: Problem on displayParams

  1. #1
    carlo75 is offline Senior Member
    Join Date
    Mar 2009
    Posts
    86

    Question Problem on displayParams

    I try to add this param, to custom/modules/Opportunities/vardefs.php

    Code:
    'javascript'=>'{literal}onblur="alert(\'test\')"{/literal}',
    when I save, empty the cache, and reload Opportunities module,
    in the specific field where I use the javascript, nothing happen.

    If I see the source HTML, there's no trace of javascript on the interested field.
    Where I wrong -.-

    Thanks in advance for all response

  2. #2
    dlorenzetti's Avatar
    dlorenzetti is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    São Paulo, Brasil
    Posts
    189

    Default Re: Problem on displayParams

    Hello,

    To add some javascript on the fields you can do that in the editviewdefs.

    custom/modules/Opportunities/metadata/editviewdefs.php


    And you can do with customCode:

    PHP Code:
    'name' => 'field_name',
    'customCode' => '<input name="field_name" id="field_name" value="{$fields.field_name.value}" maxlenght="{$fields.field_name.len}" onblur="alert(\'test\')">'
    or you can use displayParams if the field is a dropdown

    PHP Code:
    'name' => 'field_name',
    'displayParams' => array('javascript' => 'onblur="alert(\'test\')"'), 

    Don't forget if you aren't using the system as Developer Mode you need to clear cache after the changes in editviewdefs.


    Best Regards,
    Diego
    Diego Lorenzetti
    Lampada Global Services - Open Source Solutions
    Phone: +55 11 3237-3110
    Email: equipe@lampadaglobal.com
    Site: www.lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

  3. #3
    carlo75 is offline Senior Member
    Join Date
    Mar 2009
    Posts
    86

    Default Re: Problem on displayParams

    Hi Diego, thanks for your help,
    your code work like a charm,
    but there's a problem, when I save
    the data fields:

    I can't see that on the listview or editview...

    where I wrong? any idea?

  4. #4
    dlorenzetti's Avatar
    dlorenzetti is offline Sugar Community Member
    Join Date
    Jan 2008
    Location
    São Paulo, Brasil
    Posts
    189

    Default Re: Problem on displayParams

    Hi Carlo,

    What kind of field is it ?

    Does this field work file In DetailView and EditView?
    Diego Lorenzetti
    Lampada Global Services - Open Source Solutions
    Phone: +55 11 3237-3110
    Email: equipe@lampadaglobal.com
    Site: www.lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

  5. #5
    carlo75 is offline Senior Member
    Join Date
    Mar 2009
    Posts
    86

    Default Re: Problem on displayParams

    Hi Diego,
    the file is amount in Opportunities module,
    it works great on editview and listview, without
    the custom code

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 2009-05-04, 02:46 PM
  2. Replies: 0
    Last Post: 2005-06-07, 01:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •