How to set always first desc order on click header columns?

Tags: #<Tag:0x00007efc64b1b130> #<Tag:0x00007efc64b1ae88>

How to show column data in desc order first, then asc order, while click on header columns every time?
Is this possible in v.7.0.0?

Hi @karthi.gm1

I am not sure if I understand correctly. Do you want to do an initial sorting setup? If so, here https://handsontable.com/docs/javascript-data-grid/rows-sorting/#set-an-initial-sort-order is a tutorial with a demo. You need to use initialConfigwithin the columnSorting setup.

And yes, it works well also in v7.0.0. Here https://jsfiddle.net/84ybhz92/ is a demo that sorts a single column on initialization with the use of Handsontable v7.0.0.

Thanks for your reply aleksandra.
While i click on every header columns Model, Price in https://jsfiddle.net/84ybhz92/, it first shows the data in ascending order.
I am asking to show it in descending order first. Then on my next click, it can be show in ascending order.
I need to setup like this.

There is no option to control the desc/asc type of order on the header click. However, you can try to use afterColumnSort hook to run sort() again on the same column.

Thanks for your suggestion @aleksandra_budnik.

You’re welcome @karthi.gm1

I will close the topic as solved. However, please feel free to create a new one when needed.