Forums

Forums / Developing Portals / Sorting picklists

Sorting picklists

Thread is closed for posting
4 posts, 1 answered
  1. geoff.white
    geoff.white avatar
    31 posts
    Registered:
    27 Jan 2015
    22 May 2015
    Link to this post
    How do you sort a picklist?

    Be default, it orders them randomly. Not the way it is ordered in CRM.

    There is a sort option under advanced > cboPicklist > sort. I have true true, ASSC, ascending, alpha etc. but cannot get it to sort. Is there some documentation on the advanced options?
  2. Clinton Bale
    Clinton Bale avatar
    126 posts
    Registered:
    21 Feb 2014
    22 May 2015 in reply to geoff.white
    Link to this post
    Hello Geoff,

    Sorting of picklists from the configuration of the control is currently not supported at this time. However we have added this functionality to The Portal Connector 3.1.

    The default sorting order is neither the value nor the label of the picklist item, currently it is the order in which they are created in CRM.

    You can sort a picklist using JavaScript as explained here. To get the RadComboBox object you must do something like this: 

    var a = $find($(".CrmPicklist_C001").attr("id")).get_cboPicklist();
    sortRcb(a);
    

    Where CrmPicklist_C001 is the developer name of the widget​.
    Last modified on 25 May 2015 12:05 by Clinton Bale
  3. geoff.white
    geoff.white avatar
    31 posts
    Registered:
    27 Jan 2015
    24 May 2015 in reply to Clinton Bale
    Link to this post
    This hasn't worked.

    The find function you suggest doesn't work. The picklist name for developers is "CrmPicklist_C019". Yes I did pass the "a" variable into the function.
    var a = $find($(".CrmPicklist_C019").attr("id")).get_cboPicklist(); 

    The suggested function on the example passes through "null" for rcb:
    var rcb = $find("CrmPicklist_C019");

    Any further thoughts?
  4. Clinton Bale
    Clinton Bale avatar
    126 posts
    Registered:
    21 Feb 2014
    Answered
    25 May 2015 in reply to geoff.white
    Link to this post
    Hello Geoff,

    I'm assuming you also copied the function from the following link above your JavaScript code: http://www.telerik.com/forums/sorting-radcombobox-in-client-side#vmrE9OMOdE23TQRm3bHWWw

    In order to get the picklist the script you are using must be on the bottom of the page so that once it is executed all of the widgets and other code has already been executed. Make sure to set widget location of the JavaScript widget to "before the closing body tag"

    If this does not work, if you could provide more information on how the page and form is set up and the exact code fro the JavaScript that would be extremely helpful.

    Best Regards,
    Clinton


4 posts, 1 answered