Closed thezoggy closed 12 years ago
That is referring to tablesorter version 3 that I sent you. In that version, the widgets are set in the config:
$('table').data('tablesorter').config.widgets = ['zebra']; // v3 only
$('table').trigger('applyWidgets');
In the current version, use:
$('table')[0].config.widgets = ['zebra'];
$('table').trigger('applyWidgets');
(updated) or as you said, use:
$('table').data('tablesorter').widgets = ['zebra'];
$('table').trigger('applyWidgets');
Actually, I was wrong.
$('table').data('tablesorter').widgets = ['zebra'];
Will work, leave out the .config
... see this demo, I've added this example to my last comment.
thanks, i should have more time later today to play around with stuff
I'm working on adding a remove
function for each widget... they won't work with older versions of tablesorter, but in the upcoming version you will be able to trigger a refreshWidgets
event which will remove unused widgets and update selected widgets. With an additional flag, the same triggered even will remove all widgets and reinitialize the selected widgets.
// removed unused widgets and update current widgets
$('table').trigger('refreshWidgets');
or, send a true
flag along with the event:
// remove ALL widgets, then reinitialized current widgets
// current widgets are found in the `widgets` option
$('table').trigger('refreshWidgets', true);
Ok, version 2.4 is up and running... see the refreshWIdgets documentation. It is used the same as I mentioned above.
say I have a table, with:
then i have a button where I do:
should that not remove all widgets except zebra?