Column Sort doesn't return proper info when the sort is cleared

Tags: #<Tag:0x00007efc652893e0>

Hi,

Issue:
I couldn’t find a way to reopen this thread.


My question is related to it. (Feel free to close it if it is a known issue.)
My app allows user to have multiple sort and the sorting relies on the remote sort.
However, when sort goes from “desc” to “undefined”, the second parameter of “beforeColumnSort” returns an empty array. I couldn’t know which column is actually reset to “undefined”.
You can see this by clicking the column “Id” in the demo you offered in above thread.

Cause
In the method “getColumnNextConfig”, when the sortOrder is “undefined”, it simply returns the null.

Expected
I think “getColumnNextConfig” should return { column: visual column index, sortOrder: undefined} in case the sortOrder is undefined.

Thanks,

Hi @lijigang.us

thank you for sharing the topic, and sorry for keeping you waiting. I have investigated this case I was thinking about using the instance.getSelected() inside the beforeColumnSort as it returns the column that is being selected. As long as your users are doing sorting manually (not clicking a button that triggers columnSorting methods) that should do the job.

Have you tried it?

Hi @aleksandra_budnik

I will try it. Will let you know once I have the result.

Thanks so much.

Hi @lijigang.us

did you had time to test the ideas?

I believe that we can close this topic as there are no new comments within more than 2 weeks. However, if you need anything please send me an email to support@handsontable.com