Stupid-Table-Plugin
Stupid-Table-Plugin copied to clipboard
[enhancement] Option to exclude column from sorting.
Hi, thank you for this nice plugin. I got an idea for a new feature. Sometimes tables have a column with a row number. It would be useful to have an option to exclude this column from sorting.
Good point. I'll consider it, thanks!
+1 for this
Today I've a situation where this feature will be a lot usefull: One table, sortable, is a hit list. User ask me a fixed column 1.. 100, but other columns must be sortable.. I'm doing 'mumble mumble' on how to accomplish this
how to achieve this now? Both issues are closed, but no solution provided in the "documentation" :-1:
If you don't like the documentation you're free to send a PR or use a different project entirely.
I wanted to not sort one of the columns when you click on th, but it seems this plugin sorts all columns. Is there a way to exclude? I didn't see any options in the documentation as well .Thought this ticket is the closest. Thanks.
In the case of row numbers, it's possible to do this using a callback function:
var table = $('#your-table').stupidtable();
table.bind('aftertablesort', function (event, data) {
var i = 1;
$('.item-search-results td:first-child').each(function() {
$(this).html(i);
i++;
});
});