user1006072
user1006072

Reputation: 963

Jquery sort table column by checkbox state

I have a datatable that has a column called Waive Fee with checkboxes. The column needs to be sortable, i.e. when the column header is clicked, all the checkboxes that are checked needs to bubble up or bubble down. Is there a way in Jquery to do this, like calling a function on mouse event on the header and then some logic inside this function.

Please advise. Thanks

Upvotes: 1

Views: 4974

Answers (2)

aliaksej
aliaksej

Reputation: 246

Use this simple and lightweight plugin: sortElements plugin Instructions and examples here: article with instructions

It sorts elements in list

Upvotes: 2

Rishav Rastogi
Rishav Rastogi

Reputation: 15492

You can something like a table sorter plugin in jquery http://tablesorter.com/docs/ and you can use the approach to use it with checkboxes, in this link

Jquery Tablesorter - sort by column having <input> elements

Upvotes: 1

Related Questions