Stupid-Table-Plugin icon indicating copy to clipboard operation
Stupid-Table-Plugin copied to clipboard

[enhancement] Option to exclude column from sorting.

Open aTanCS opened this issue 11 years ago • 7 comments

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.

aTanCS avatar Feb 17 '14 16:02 aTanCS

Good point. I'll consider it, thanks!

joequery avatar Feb 17 '14 16:02 joequery

+1 for this

realtebo avatar Feb 17 '14 16:02 realtebo

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

realtebo avatar May 06 '14 08:05 realtebo

how to achieve this now? Both issues are closed, but no solution provided in the "documentation" :-1:

xcy7e avatar Jul 22 '15 09:07 xcy7e

If you don't like the documentation you're free to send a PR or use a different project entirely.

joequery avatar Jul 22 '15 14:07 joequery

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.

ghost avatar Dec 19 '15 04:12 ghost

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++;
	});
});

ethmz avatar Apr 14 '17 14:04 ethmz