Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By rafael.q.g@hotmail.com

Thread: Custom Javascript tutorial

  1. #1
    Linnane is offline Sugar Community Member
    Join Date
    Jun 2009
    Posts
    64

    Default Custom Javascript tutorial

    Hi,

    I've added custom JavaScript to a module ... its triggered when a checkbox is "checked" by the user, however if I modify the module in the admin - studio I loose my changes as the code is overwritten.

    I kinda thought this would happen but don't know to do it without the "save & deploy" overwriting my code.

    1) Is it possible ... I presume so?

    2) Is there a novice tutorial just to get a "hello world!" from a checkbox onclick event?

    Regards
    Alan

  2. #2
    rafael.q.g@hotmail.com's Avatar
    rafael.q.g@hotmail.com is offline Sugar Community Member
    Join Date
    Jun 2011
    Location
    Florianópolis - Brazil
    Posts
    782

    Default Re: Custom Javascript tutorial

    Once you want to do more advanced changes as adding events and javascript code to your inputs, I recomment you do to do that via coding not studio.
    1. Open the file editviewdefs.php for your module.
    2. Add customCode to your field.
    3. Open sugar via web interface, go to admin area, go to repair, and request a repair/rebuild.

    This way your changes will be depoloyed.
    Rafael Queiroz Gonçalves
    Advanced OMG UML Certified Professional
    Sun Certified Enterprise Architect for the Java Platform
    Sun Certified Programmer for the Java 2 Platform
    IBM Certified Advanced Application Developer - Lotus Notes and Domino
    IBM Certified Application Developer - IBM WebSphere Portlet Factory
    Computer Science Mastering / UFSC - PPGCC

  3. #3
    Linnane is offline Sugar Community Member
    Join Date
    Jun 2009
    Posts
    64

    Default Re: Custom Javascript tutorial

    Hi,

    Thanks for your reply

    Does this mean I lose the ability to use the Studio for that module forever?
    Or is it that after I do a repair/rebuild, I can reuse the studio again?

    The editviewdefs.php you referred to, is that's the one in "custom\modules\[module_name]\metadata" ?


    Alan.

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: 2011-05-16, 02:50 PM
  2. Replies: 0
    Last Post: 2009-07-06, 06:49 PM
  3. How do I add custom JavaScript
    By machineghost in forum Developer Help
    Replies: 6
    Last Post: 2008-11-13, 09:19 PM
  4. Help on Custom Aging Field Tutorial
    By mushtaq10 in forum Help
    Replies: 1
    Last Post: 2008-05-11, 03:55 PM
  5. Custom fields tutorial
    By ymsellek in forum Help
    Replies: 0
    Last Post: 2005-03-02, 10:29 AM

Tags for this Thread

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
  •