Sort automatically in the change of context from listbox

Hi,

I studied listbox and tried to the example(https://ej2.syncfusion.com/vue/documentation/list-box/dual-list-box/)
I would like to make the listbox is always sorted when the context is changed
How can I fix the code simply.
Thanks

Franky

1 Reply 1 reply marked as answer

MK Mohan Kumar Ramasamy Syncfusion Team November 16, 2020 02:27 PM UTC

Hi Franky , 
 
We have checked your reported query. We can achieve your requirement using sortOrder property. Please refer below code snippets. 
 
 
<template> 
  <div id="container" style="margin: 10px auto 0; width: 430px"> 
    <div class="listbox1"> 
      <h4>Group A</h4> 
      <ejs-listbox 
        :dataSource="groupA" 
        :fields="fields" 
        scope="#listbox" 
        :toolbarSettings="toolbarSettings" 
        sortOrder="Descending" 
      ></ejs-listbox> 
    </div> 
    <div class="listbox2"> 
      <h4>Group B</h4> 
      <ejs-listbox 
        id="listbox" 
        :dataSource="groupB" 
        :fields="fields" 
        scope="combined-list" 
        sortOrder="Ascending" 
      ></ejs-listbox> 
    </div> 
  </div> 
</template> 
 
 
For your reference we have prepared a sample based on this, please refer below sample link. 
 
 
 
Please let us know, if you need any further assistance. 
 
Regards, 
Mohan kumar R 


Marked as answer
Loader.
Up arrow icon