Multiple columns sorting issue

2 posts, 0 answers
  1. Maryia
    Maryia avatar
    3 posts
    Member since:
    Jan 2018

    Posted 13 Sep 2018 Link to this post


    I am applying sort to 3 different columns: 
    range.sort([{column: 3, ascending: true}, {column: 4, ascending: true}, {column: 5, ascending: true}]);

    You can see that CLIENT column is not sorted properly ('Alexandra Kennedy' is located at 12th row but should be at the top);
    Seems to happen when I have more than 2 columns for sort.
  2. Dimitar
    Dimitar avatar
    809 posts

    Posted 17 Sep 2018 Link to this post

    Hello Mariya,

    The Kendo UI Spreadsheet's range.sort() method sorts column values based on the index. For example, when three column sort objects are passed to the function, the second column will be sorted based on the first column indexes, and the third column will be sorted based on the first and second column indexes. This is described in the API reference:

    The built-in sort behavior of the Spreadsheet works differently than the one provided by Excel, where the functionality works based on a 'then-by' principle. I would encourage you to log this as a new feature request in the Kendo UI Feedback Portal. This way, the rest of the community will be able to discuss and vote for this feature. Based on the demand and gathered feedback, this could be scheduled for implementation in a future release.

    As a workaround for the current scenario, I would suggest first sorting the data on the server and then using the fromJSON() method to load the data into the Spreadsheet. You could refer to the following demo, where the mentioned method is used to retrieve the data from a remote end-point and then bind it to the widget:

    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top