SearchPanes custom ordering in one pane
SearchPanes custom ordering in one pane

Currently in a table I have data in one column that supplies a search pane thusly:
1-1
100-249
1k+
2-50
250-299
300-999
51-99
What I want is for that search pane to look like:
1-1
2-50
51-99
100-249
250-299
300-999
1k+
Is this possible?
This discussion has been closed.
Answers
Hi @BPAT ,
The panes are DataTables themselves. You can set their config using the
searchPanes.dtOpts
config option, and set the config for a specific pane usingcolumns.searchPanes.dtOpts
. You should be able to add an ordering plug-in that way.Thanks,
Sandy
So I did this and it puts stuff in the search pane, but search pane still orders it and I don't know enough about what I'm doing to get the search pane to impact the table filtering. Thanks for your help Sandy. I will look at what you pointed me to. I guess I have to get smarter.
searchPanes: {
options:[
{
label: '1-1',
value: function(rowData, rowIdx){
return rowData[8] = '1-1';
}
},
{
label: '2-50',
value: function(rowData, rowIdx){
return rowData[8] = '2-50';
}
},
{
label: '100-249',
value: function(rowData, rowIdx){
return rowData[8] = "100-249";
}
},
Hi @BPAT ,
I don't think you want to do what you have above.
Take a look at this page. You will want to create a function as is documented there. Then check the type and if it is sort then return whatever value you want to sort on. If you are defining custom options you may be able to just hard code it there?
Thanks,
Sandy