Our blazing fast Grid component built with pure JavaScript


Post by kyle.kottyan »

Hello,

I am currently encountering some incorrect sorting result afters implementing a multi-sort programmatically. I currently have custom sorting logic defined on each of the relevant column definitions using the sortable property. Additionally, I have the prioritizeColumns property set to true in the Grid's configuration object such that those functions are respected when performing programmatic sorts.

When I trigger the multi-sort, I do notice the sub numerics in the column headers denoting that it is part of the multi sort and which feature in the sort that it is. The issue is that when I start adjusting the features (adding/removing/changing ascending/descending) the resulting view does not always align with what's expected. Sometimes it seems as if some of the features of the multi sort are not executing their custom sortable functions.

To this post, I have attached a JavaScript file that I constructed similar to how I'm implementing at least the custom sorting functions on the columns. I am testing how those interact with the column-based controls for multi sort.

I was just pasting this into the code area on this page: https://bryntum.com/products/grid/examples/sorting/

I was still able to reproduce the behavior with the example's configuration. All you need to do is define some custom sort functions on some of the columns.

When I remove those custom sorting functions on the columns, the issue no longer occurs, but the behavior is incorrect per my sorting requirements. Could it be my data or my sort function implementations? Should I define this on the Sorter configuration object I pass into the SortStore::sort method instead of on the column definition?

{
    field: 'name',
    ascending: true,
    fn: (record1, record2) => ...
}

Please let me know if you need more information or would be able to help fix my approach. Thank you.

refs:
https://www.bryntum.com/products/grid/docs/api/Core/data/mixin/StoreSort#function-sort
https://www.bryntum.com/products/gantt/docs/api/Grid/feature/Sort

Attachments
bryntum-column-based-multisort-example.js
(4.07 KiB) Downloaded 23 times

Post by kyle.kottyan »

I just want to update that I found the open issue on the Bryntum GitHub: https://github.com/bryntum/support/issues/5325


Post by mats »

Thanks, we'll try to prioritize this!


Post Reply