Hi Friends, I got efficient solutions on DP from fellow DPers couple of time.. U guys ROCK !!! I would like to know if we can sort a table 2 way using Javascript. For example, if we have a table with information of hotels and there are 2 (numeric) columns Price and Rating. How to sort the table based on Price first and then on Rating.. i.e., It is like if prices of two hotels are same, they need to sorted as per their rating.. Hope my question is clear. Eagerly waiting for ur replies.. Regards,
I'm doing that with XSLT transformations on client. You can have 1, 2, 3... or n sorting fields, aplying sequentially. You only need to ad as many <xsl:sort> expressions inside your <xsl:for-each> loop. But IMO this XSLT transformation method is only por advanced AJAX users. Maybe other DP users know some javascript libraries to do that .
Hi, Thanks for the suggestion.. But i want to see if it can be done using simple javascript. Regards,
Some examples... http://www.joostdevalk.nl/code/sortable-table/ http://kryogenix.org/code/browser/sorttable/ http://webfx.eae.net/dhtml/sortabletable/sortabletable.html http://www.mattkruse.com/javascript/sorttable/