Expand my Community achievements bar.

SOLVED

Sorting in CQ5 Dialog SelectBox Dropdown

Avatar

Level 3

Hi All,

We are displaying list of IDs for example 3111111,3333333,3222222,21111111... etc in an dropdown of CQ5 dialog where author choose one and enter content so that the content will be persisted with ID in the jcr content.

The issues is how to sort the numbers and display them in ASC/Desc order. I tried with sortDir property of Xtype select and it not sorting the above string values.when i research i found the property will be used to sort only characters.

how to sort the above kind of values. the dropdown is huge and it is hectic for author to choose the ID from the drop down.

Please suggest the way to handle this 

1 Accepted Solution

Avatar

Correct answer by
Level 10
        Write a custom xtype that works with the data. Order the data in an event handler method in the script and then set the data in the drop down. We have a community article that shows how to dynamically work with data in a custom xtype: http://helpx.adobe.com/experience-manager/using/dynamically-updating-aem-custom-xtype.html

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10
        Write a custom xtype that works with the data. Order the data in an event handler method in the script and then set the data in the drop down. We have a community article that shows how to dynamically work with data in a custom xtype: http://helpx.adobe.com/experience-manager/using/dynamically-updating-aem-custom-xtype.html