Sorting Columns in Wijmo (same values in column)

Posted by: pyj0695 on 9 June 2021, 11:56 pm EST

  • Posted 9 June 2021, 11:56 pm EST

    I forced the id to be 0 and made the id the same.

    Sorting was performed by clicking the next Country column, and then Sorting was performed by clicking the id column.

    Because it is a SingleColumn sort, the data should not change when you click the id column, but the overall data is sorted.

    I wonder why this is happening, how do I prevent the data from changing and not sorting when I click on the id column?

  • Replied 10 June 2021, 11:21 pm EST


    This phenomenon is known as the stable sort, whenever there are two records R and S with the same key and with R appearing before S in the original list, R will appear before S in the sorted list.
    So whats is happening here is when you click on the id column to sort the values, it gets sorted in the order stored in the data (collectionView).
    You can prevent sorting on specific columns by setting allowSorting property of the column to false. Please refer to the code snippet:
    theGrid.getColumn("id").allowSorting = false;

    Let us know that's works for you.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels