Possible date sort bug (Chrome works)


#1

So I have grid of data that has a default sort (Page level) on a date field. It shows the data in descending order (newest to oldest) while the data in the system is the opposite since it was entered oldest to newest. The load works as expected however when I page to the second page it reverts to the oldest records and then maintains that sort even if I go back to page 1. There is a separate event sort on the grid to allow the users to change this default if they wish. If I set the sort manually on the CreatedOn datetime paging works fine. The real gotcha is it works as intended with no problem going page to page in Chrome. I have tested Microsoft Edge, Internet Explorer, and Firefox and each of those browsers break when going to page 2.


#2

The LoadData event of the DataGrid triggers when you change the page. You should make sure the $orderby parameter is specified accordingly. In your other thread you are setting the $orderby parameter to ${event.orderby} because you want your user to be able to change the sort order. If you want to have a default sort order AND allow the user to override it you will have to set the $orderby parameter in the LoadData event handler like this: ${event.orderby || 'Created desc'}


#3

Thanks. I had thought that since one was applied on page load it would remember that unless a user changed it. It felt strange that Chrome does behave that way. I was only alerted to it not working since I have a user that uses IE mainly.