I am using a custom sorting function on one of my columns with field name of "los" using data from a different column with field name "elapsed":
sorter: function(a, b, aRow, bRow, sorterParams) {
return (aRow.getData().elapsed) - (bRow.getData().elapsed);
}
I would like to achieve 2 things:
i.e what I want to achieve is:

but the default sorting behaviour of tabulator is resulting in:

headerClick function that has to be the same for all columns?If these things are not possible, would you consider adding into a future tabulator release ability to 'ignore blanks' on sorting and 'fix row groups' on sorting?
Hey @tomheaps,
Sorry for the delay in getting back to you on this one, i have been moving house so not had much free time the last few weeks.
you can certainly do this, in the latest version of Tabulator there are additional arguments passed into the sorter function:
sorter:function(a, b, aRow, bRow, column, dir, sorterParams){
The dir argument lets you know if it is being sorted asc or desc which would let you choose how to sort the empty columns in these situations:
sorter:function(a, b, aRow, bRow, column, dir, sorterParams){
if(dir == "asc"){
return (aRow.getData().elapsed || 9999999999) - (bRow.getData().elapsed || 9999999999);
}else{
return (aRow.getData().elapsed) - (bRow.getData().elapsed);
}
}
The above example is overly simplistic but it should give you an idea of where to go
Let me know if that helps,
Cheers
Oli
No worries. I suspected something was going on in your life because you weren't answering issues in your usual ultra-rapid fashion!! I have been trying to help out and answer some questions whenever I can. I have been noticing that as the popularity of tabulator grows (as it inevitably will given it is such an awesome piece of coding) that more and more people are posting banal questions, making very little effort to read the documentation (which would answer their questions) or expecting you to provide a free coding service.
Have you ever considered creating a tabulator tag on stack overflow, restricting issues on github to genuine bugs/feature requests and directing all other questions for help with coding to stack overflow to minimize your workload??
I had noticed you were answering a load of the questions, thanks for helping out and taking some of the load on yourself, it has been a great help!
And thanks for your kind words about Tabulator :D
Sadly i haven't contributed as much as i would like to stack overflow so don't have enough rep to create a tag yet, but i do like that idea a lot, it would keep the issues list clear for actual bug/feature requests. I have been answering the few questions that have been asked there. i dont suppose you have enough rep to add a tag? if we can get one created i will update the documentation on the website to direct people to ask questions in stack overflow.
Cheers
Oli
Unfortunately, like yourself, I have a poor rep on SO (39 points only) and 1500 are required to create new tags. We could try asking @mikeshow who is the only other person I have seen regularly contributing to the tabulator issues pages?
@olifolkerd
There is now a tabulator tag on SO.
AMAZING!, Thanks @E3V3A
Most helpful comment
@olifolkerd
There is now a
tabulatortag on SO.