SortOrder by value and not by text

Hey

I have a drop down list that takes the fields from a lookup (each item has value + text (shows text))

how can i sort order by the value of the item and not but the text of the item (if i just add Sortorder = ascending it sort the items by the text )

value in purple as you can see 3 and 6 month should be above 1 year




1 Reply 1 reply marked as answer

VJ Vinitha Jeyakumar Syncfusion Team March 31, 2022 09:54 AM UTC

Hi EyaL,


Your requirement to sort order by value instead of text field can be achieved by using Query property where we can apply sortBy. please check the code below,

Code snippet:
this.query = new Query().sortBy('Id''ascending').take(10);
 
<DropDownListComponent
                  id="games"
                  query={this.query}
                  dataSource={this.sportsData}
                />



Regards,
Vinitha

Marked as answer
Loader.
Up arrow icon