Have a column ignore sorting
Have a column ignore sorting
isleshocky77
Posts: 4Questions: 0Answers: 0
I believe I've read through all of the examples, docs, and apis; and I still can't find how to do this or if it is possible at all. I need to be able to have one column completely ignore sorting.
The use-case for this to make it more clear what I'm trying to do is that the first column of my table is called rank which is a linear set of numbers. I would like when you sort any of the other columns that the first column containing the rank still say in the same order from 1 to X.
I've looked into possibly using mData, but it doesn't seem to have an index I can base it off of.
Thoughts?
JSFiddle: http://jsfiddle.net/isleshocky77/6MhZ6/
The use-case for this to make it more clear what I'm trying to do is that the first column of my table is called rank which is a linear set of numbers. I would like when you sort any of the other columns that the first column containing the rank still say in the same order from 1 to X.
I've looked into possibly using mData, but it doesn't seem to have an index I can base it off of.
Thoughts?
JSFiddle: http://jsfiddle.net/isleshocky77/6MhZ6/
This discussion has been closed.
Replies
Allan
Essentially think of the first column as another set of headers. I thought maybe giving them th instead of td would allow for this; but not so. Currently the only thing I can think to do would be to put another table next to the table with datatable with just the column; however, I don't believe that is a good solution.
Allan
[code]
var that = this;
[/code]
Heh - I am the "development team" :-)
Thanks for pointing out the error on the page. I've just corrected it.
The example has been rewritten for DataTables 1.10, which I think now uses a more elegant solution: https://github.com/DataTables/DataTables/blob/1_10_wip/examples/api/counter_columns.html#L31
Allan