Table and Data Array

P

Ph.E

Hello Friends,
Anyone know tell me the best library or framework to implement a
table with automatic sorting of columns? There are several such as
FlexGrid, but would like to know what is the fastest and powerful.

Thanks
 
R

RobG

Hello Friends,
   Anyone know tell me the best library or framework to implement a
table with automatic sorting of columns? There are several such as
FlexGrid, but would like to know what is the fastest and powerful.

You don't need a library, the principle is fairly simple and depending
on your requirements, might be less than 50 lines of code - a little
more if you want to include sorting numbers and dates. It's often
implemented as a single listener on the table, but can also use a row
in the thead and tfoot sections.

There are a number of table sorting scripts around, it's one of those
things typically attempted when confidence with the DOM is thought
sufficient. Search the archives and post what you come up with.
You'll need to define what "automatic" means and whether you are
sorting the columns (left to right I suppose) or sorting rows by the
values in a particular column.

It helps if each column is put into a colgroup, it saves iterating
over the rows to get the column's cell values. It also helps for
sorting columns as the entire colgroup can be moved rather than the
individual cells in each row.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,102
Messages
2,570,646
Members
47,254
Latest member
GayMilline

Latest Threads

Top