[jQuery] Tablesorter column order - how to sort on a column id
Hi there,
I am using Christian's tablesorter plugin for a large table, and this
table has a varying number of columns displayed based on a user's
cookie settings. Sometimes a user wants to see 20 columns, sometimes
only 4 - it depends on what they are interested in monitoring. All
these columns have a unique id, so they can be addressed individually.
However, my problem is that in the tablesorter code the sortList
method is based on integers representing the columns (which I know
makes sense). Because my columns dynamically change based on a user's
cookie settings, I was wondering if there was a way of using column
ids rather than integers for the sortList method.
Thinking about this I guess I could just read the cookie with Klaus'
cookie plugin, and then map the number of ids to integers pretty
easily. Has anyone done this successfully, or written a method for
tablesorter that does this already? I guess I would need to call this
function before the tablesorter call, in order to reorder the sortList
as required.
Thanks in advance!