phil swenson
phil swenson

Reputation: 8894

JQuery table w/ sorting

There are all kinds of JQuery widgets that offer some nice features like sorting by a columns (like http://tablesorter.com/docs/ or http://www.datatables.net/)

I haven't found one that integrates with server side sorting though. I have the following requirements:

  1. sort by clicked column (server side sort)
  2. filter by a text field over each column
  3. selectable which columns to display

any suggestions on a widget that has some or all of these criteria?

thanks

Upvotes: 1

Views: 792

Answers (4)

Tawani
Tawani

Reputation: 11198

Try Tiny Table. It does not require jQuery but you put a wrapper around it.

http://www.leigeber.com/2009/03/table-sorter http://www.leigeber.com/2009/03/table-sorter

alt text
(source: leigeber.com)

Upvotes: 0

Khanh Tran
Khanh Tran

Reputation: 447

I think DisplayTag is your solution. It was used to display data for servlets, portlets and it supports a lot of functions like paging, sorting on server side.

Upvotes: 0

Tony Miller
Tony Miller

Reputation: 9159

As a step up from rolling your own (which is not a bad suggestion, BTW), try this jQuery plugin out: Ingrid. The descriptions of the code talk about using server side data generation.

Upvotes: 0

geowa4
geowa4

Reputation: 41803

Honestly, I would prefer to roll my own in this situation. Filtering is especially easy using jQuery: $('tr > td.columnName').each(...); just set the display style of the row to none if it doesn't match, block otherwise. Hiding columns can be done in a similar manner. Sorting isn't too bad--though notably more complicated. You need to sort (which can take a while, depending on your algorithm) and then place the rows into the table in the order you determined.

Alternatively, find a plug-in that has sorting accomplished, but also generates simple markup, so you can extend it with your own filtering.

Upvotes: 1

Related Questions