EJ2 Grid: Sorting not working after the 2nd query

Hi,

We have an ASP.NET MVC application with EJ2.
There's a bug on our EJ2 Grid if we sort the same column 3 times consecutively (eg. ASC then DESC then ASC again).

- when we click the 1st time on the column header we have this in the request body

{
requiresCounts: true,
skip: 0,
sorted: [{
               name: "OurSortableColumn",
       direction: "ascending"
}],
take: 25
}

- we get the same data during the 2nd query

- the problem appears when we click the 3rd time on the same column, we don't have the "sorted" property anymore and it generates a bug on our back-end service.
{
requiresCounts: true,
skip: 0,
take: 25
}

Please note that there's no problem if we click on different columns consecutively.
What might cause this problem?

Thanks


3 Replies

PK Prasanna Kumar Viswanathan Syncfusion Team February 27, 2020 09:34 AM UTC

Hi Arcania, 
 
Greetings From Syncfusion Support. 
 
Based on your query that you do not have sorted property when you click on the third time on the same column.  
 
By default, the sorting order will be as ascending -> descending -> none. When first click a column header it sorts the column in ascending. Again click the same column header, it will sort the column in descending. A repetitive third click on the same column header will clear the sorting. So, it does not send any information about sorting to the server. It was the default behavior of our Grid. 
 
Please share the exact requirement based on sorting, so we will provide solution based on that. 
 
Regards, 
Prasanna Kumar N.S.V 
 



SA Support Arcania March 4, 2020 11:29 AM UTC

Hi,

Thanks for your reply.
We didn't know this information.
We've added a default column and sort direction in our back-end service as a workaround.

Thanks


PK Prasanna Kumar Viswanathan Syncfusion Team March 9, 2020 01:40 PM UTC

Hi Arcania, 
 
Thanks for the update. 
 
Please get back to us if you need any further assistance on this. 
 
Regards, 
Prasanna Kumar N.S.V 


Loader.
Up arrow icon