Sorting array data

Hi, I am using your React ej-2 Grid service for my project. The builtIn sorting functionality works great for the all the columns except , for the column which is populated by data in an array format-[xyz:"data"].

 Is there a way to sort a column  which is populated by array data?

Data

xyz:["data-1","data-2"]


Column

column:object[]=[

{field:"xyz", headerText:"xyz", width:200}

{field:"abc", headerText:"xyz", width:200}

{field:"asd", headerText:"xyz", width:200}

]


Thanks a lot

YM



1 Reply

AG Ajith Govarthan Syncfusion Team July 8, 2021 04:14 PM UTC

Hi ym, 
  
Thanks for contacting Syncfusion support. 
  
Query: Hi, I am using your React ej-2 Grid service for my project. The builtIn sorting functionality works great for the all the columns except , for the column which is populated by data in an array format-[xyz:"data"]. 
  
We have checked your attached code example and found that you have used the array values for xyz field in your Grid application.  
  
  
   xyz:["data-1","data-2"]  //  here you have used array values. 
  
By default, in EJ2 Grid we do not have support to handle the filtering, grouping and sorting operations for array values as column data. You can perform the filtering, grouping and sorting for data like string, number, dateObject or complex object data. Which is the default behavior of our EJ2 Grid. 
  
"BronTabelNaam": "someStringValue",    // you can use string or number or date object here 
"xyz:  {"Id": 1, "Naam": { "Idprime": 2, "Namane": "another name"} }   // complex data . 
  
  
Please get back to us if you need further assistance. 
  
Regards, 
Ajith G. 
  
  


Loader.
Up arrow icon