Skip to Content
avatar image
Former Member

Table Sorting

Hi All,

Is there a way to sort a table by two columns?

I don't need sorting actions on the table hedaers or a single column sort, which TableSorter enables.

I will give an example:

Table before sorting

A U 200

B H 100

A I 300

B A 400

Table after sorting

A I 300

A U 200

B A 400

B H 100

Thanks,

Aviad

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 25, 2006 at 08:35 AM

    Hi Aviad,

    Check

    Usage of the Node-Function "sortElements"

    Especially general helper class from Valery: sorting by mulyiple attributes

    node.sortElemenst(   new GenericNodeElementComparator  (    new OrderingExpression().desc("Salary").asc("Name")  ));
    

    Best regards, Maksim Rashchynski.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 25, 2006 at 08:34 AM

    Hi,

    It depends where your data is coming from...

    If you are getting the data from a backend SAP system for instance via RFC it is very easy for the data to be sorted before it is returned.

    If you are building up the data in purely Java then you will need to write a sorting routine - search on Google for help on this as I'm sure its been done hundreds of times before!

    Hope this helps,

    Gareth.

    Add comment
    10|10000 characters needed characters exceeded