Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Custom sort not working help please

  1. #1
    kinshibuya's Avatar
    kinshibuya is offline A Sugar Hero
    Join Date
    Jul 2008
    Location
    brasil
    Posts
    521

    Default Custom sort not working help please

    Hi!
    i need some help.
    I tryed to customize the subpanel listview of contacts to sort the field, account_name.
    I added the sortable=>true and it works, but it's not sorting rigth. I guess it's sorting by id. what to do? any ideas?

  2. #2
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Custom sort not working help please

    Quote Originally Posted by kinshibuya
    Hi!
    i need some help.
    I tryed to customize the subpanel listview of contacts to sort the field, account_name.
    I added the sortable=>true and it works, but it's not sorting rigth. I guess it's sorting by id. what to do? any ideas?
    In my listviewdefs I have the following

    'ACCOUNT_NAME' =>
    array (
    'width' => '34%',
    'label' => 'LBL_LIST_ACCOUNT_NAME',
    'module' => 'Accounts',
    'id' => 'ACCOUNT_ID',
    'link' => true,
    'contextMenu' =>
    array (
    'objectType' => 'sugarAccount',
    'metaData' =>
    array (
    'return_module' => 'Contacts',
    'return_action' => 'ListView',
    'module' => 'Accounts',
    'parent_id' => '{$ACCOUNT_ID}',
    'parent_name' => '{$ACCOUNT_NAME}',
    'account_id' => '{$ACCOUNT_ID}',
    'account_name' => '{$ACCOUNT_NAME}',
    ),
    ),
    'default' => true,
    'sortable' => true,
    'ACLTag' => 'ACCOUNT',
    'related_fields' =>
    array (
    0 => 'account_id',
    ),
    ),

    It works
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  3. #3
    kinshibuya's Avatar
    kinshibuya is offline A Sugar Hero
    Join Date
    Jul 2008
    Location
    brasil
    Posts
    521

    Default Re: Custom sort not working help please

    I guess mine is Exacly the same

    Code:
      'ACCOUNT_NAME' => array(
                    'width' => '34%',
                    'label' => 'LBL_LIST_ACCOUNT_NAME',
                    'module' => 'Accounts',
                    'id' => 'ACCOUNT_ID',
                    'link' => true,
            'contextMenu' => array('objectType' => 'sugarAccount',
                                   'metaData' => array('return_module' => 'Contacts',
                                                       'return_action' => 'ListView',
                                                       'module' => 'Accounts',
                                                       'return_action' => 'ListView',
                                                       'parent_id' => '{$ACCOUNT_ID}',
                                                       'parent_name' => '{$ACCOUNT_NAME}',
                                                       'account_id' => '{$ACCOUNT_ID}',
                                                       'account_name' => '{$ACCOUNT_NAME}'),
                                  ),
            'default' => true,
            'sortable'=> true,
            'ACLTag' => 'ACCOUNT',
            'related_fields' => array('account_id')),
    But i'm tryuing to sort the columns on the contacts subpanel, how is your /sugarcrm/modules/Contacts/metadata/subpanels/default.php?
    My is like this:

    Code:
    
         'account_name'=>array(
                            'module' => 'Accounts',
                            'target_record_key' => 'account_id',
                            'target_module' => 'Accounts',
                            'widget_class' => 'SubPanelDetailViewLink',
                            'vname' => 'LBL_LIST_ACCOUNT_NAME',
                            'sortable'=>true,
                            'width' => '22%',
                    ),

  4. #4
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Custom sort not working help please

    Sorry I misunderstood
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  5. #5
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Custom sort not working help please

    In my cases subpanelI have this and it works

    'account_name'=>array(
    'vname' => 'LBL_LIST_ACCOUNT_NAME',
    'widget_class' => 'SubPanelDetailViewLink',
    'module' => 'Accounts',
    'width' => '31%',
    'target_record_key' => 'account_id',
    'target_module' => 'Accounts',
    ),
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  6. #6
    kinshibuya's Avatar
    kinshibuya is offline A Sugar Hero
    Join Date
    Jul 2008
    Location
    brasil
    Posts
    521

    Default Re: Custom sort not working help please

    ok. I'm trying to sort the field: account_name on the contact's subpanel.
    but it's sorting it wrong,

    I attached the image to the post.
    Attached Images Attached Images  

  7. #7
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Custom sort not working help please

    What code do you have in the subpanel?
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  8. #8
    kinshibuya's Avatar
    kinshibuya is offline A Sugar Hero
    Join Date
    Jul 2008
    Location
    brasil
    Posts
    521

    Default Re: Custom sort not working help please

    'account_name'=>array(
    'module' => 'Accounts',
    'target_record_key' => 'account_id',
    'target_module' => 'Accounts',
    'widget_class' => 'SubPanelDetailViewLink',
    'vname' => 'LBL_LIST_ACCOUNT_NAME',
    'sortable'=>true,
    'width' => '22%',
    ),

  9. #9
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Custom sort not working help please

    strange - it works for me in cases

    what happens if you remove the 'sortable'=>true,?

    I don't have that but it sorts properly
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  10. #10
    kinshibuya's Avatar
    kinshibuya is offline A Sugar Hero
    Join Date
    Jul 2008
    Location
    brasil
    Posts
    521

    Default Re: Custom sort not working help please

    Nothing happens, it doesn't change anything

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. upgraded to 4.5.1e, received "Metadata for table tracker does not exist"
    By sfgeorge in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2007-09-03, 02:24 PM
  2. Replies: 1
    Last Post: 2007-08-28, 11:38 PM
  3. Replies: 3
    Last Post: 2007-08-09, 01:47 PM
  4. Asterisk Patch 1.1.0 Crash on logon
    By skyracer in forum Help
    Replies: 6
    Last Post: 2006-07-08, 06:30 AM
  5. Replies: 7
    Last Post: 2006-06-06, 07:56 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
  •