Sort grid with multiple columns

I found this code snippet for sort, but it doesn’t support sorting by multiple columns.

treeGrid.data.sort({
by: “price”,
dir: “asc”,
as: function (value) { return value ? value : “” }
});

Please, try to call another similar sort() function for the second column after that.
Grid/TreeGrid supports stable sorting by default.

can you please provide an example

Here is the example:
https://snippet.dhtmlx.com/86hnt112
You can notice that after the sorting by “country” the “yearlyChange” column is sorted by “asc” order according to the duplicated values of “country”.

1 Like

thanks will try to implement this way