Results 1 to 6 of 6

Thread: custom related field (add new button to this field)

  1. #1
    garciasanchezdaniel's Avatar
    garciasanchezdaniel is offline Sugar Community Member
    Join Date
    Aug 2011
    Location
    Spain
    Posts
    403

    Thumbs up custom related field (add new button to this field)

    Hello everyone, I'd like add a new button to one relate field, this is, in addition of the buttons select and clear, I want to add a button create in order to open a popup to create a new record of the module in this popup....is this possible?

    Thanks
    Attached Images Attached Images  

  2. #2
    christianknoll's Avatar
    christianknoll is offline Sugar Community Member
    Join Date
    Nov 2008
    Location
    Vienna
    Posts
    939

    Default Re: custom related field (add new button to this field)

    Copy the relate field to a new field and adapt this custom field.

    not too difficult.

    christian.

    Quote Originally Posted by garciasanchezdaniel View Post
    Hello everyone, I'd like add a new button to one relate field, this is, in addition of the buttons select and clear, I want to add a button create in order to open a popup to create a new record of the module in this popup....is this possible?

    Thanks

  3. #3
    garciasanchezdaniel's Avatar
    garciasanchezdaniel is offline Sugar Community Member
    Join Date
    Aug 2011
    Location
    Spain
    Posts
    403

    Default Re: custom related field (add new button to this field)

    Quote Originally Posted by christianknoll View Post
    Copy the relate field to a new field and adapt this custom field.

    not too difficult.

    christian.
    Have I to create other field necessarily?

  4. #4
    garciasanchezdaniel's Avatar
    garciasanchezdaniel is offline Sugar Community Member
    Join Date
    Aug 2011
    Location
    Spain
    Posts
    403

    Default Re: custom related field (add new button to this field)

    I tried editing the file: editviewdefs.php , adding to the field this customCode::

    PHP Code:
    'customCode' => <input class="button" onclick="open(url);" value="open window with button"
    And in the top of the editviewdefs.php I added:

    PHP Code:
    <script language="javascript"
    function 
    abrir(){ 
         
    window.open(url); 
    }                     
    </script> 
    But now I see my related field strange...haha...I can not introduce a value because is filled with the new button...any suggestions?
    thanks!!
    Last edited by garciasanchezdaniel; 2011-09-22 at 05:47 PM.

  5. #5
    garciasanchezdaniel's Avatar
    garciasanchezdaniel is offline Sugar Community Member
    Join Date
    Aug 2011
    Location
    Spain
    Posts
    403

    Default Re: custom related field (add new button to this field)

    any suggestions?

  6. #6
    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 related field (add new button to this field)

    1. Make your relate field as default, without custom code.
    2. Open your form in edit view and ensure the relate field is working.
    3. Open the source code of this page.
    4. Copy the code used to renderize the relate field and the two buttons (Select and clear)
    5. Now return to your custom code place, and paste the selected code.
    - Your relate field should still be working here (test it to have sure)
    6. Append to your custom code content the html code to renderize this new create button.
    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

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 2011-06-06, 02:12 PM
  2. Add user related custom field
    By kuske in forum Developer Help
    Replies: 14
    Last Post: 2011-02-08, 06:17 AM
  3. Retrieve field from related custom module
    By bstonehill in forum Developer Help
    Replies: 0
    Last Post: 2010-12-10, 06:10 PM
  4. Replies: 3
    Last Post: 2010-05-11, 10:30 AM
  5. Related field to custom module
    By Billwobo in forum Help
    Replies: 2
    Last Post: 2008-07-03, 12:05 PM

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
  •