get name of sorted column from table

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

get name of sorted column from table

Postby gabrielaradu » Mon Aug 02, 2010 4:35 am

Hello,
This might not be the proper place to ask this and it is a very stupid(newbie) question :oops:
I have this table, i sort some columns and now i want to know exactly the name of the column that was sorted and in what state it is: sorted ASC , or DESC.
This method: "getSortingColumns()" returns the columns i sort but it;s like this: com.jidesoft.grid.ISortableTableModel$SortItem@1b66aff.
I thought that this object has a property like "getName()" or something, but it doesn't. I might be going in the wrong way here , don't know. If you have an idea please guide me on the right direction.
Thank you
gabrielaradu
 
Posts: 2
Joined: Mon Aug 02, 2010 4:27 am

Re: get name of sorted column from table

Postby gabrielaradu » Mon Aug 02, 2010 4:55 am

I found my problem 8)

after i get the list of sortedColumns, i iterate over it
for (Iterator iterator = sortingColumns.iterator(); iterator.hasNext();) {
SortItem item = (SortItem)iterator.next();
System.out.println("no of column : " + item.getColumn());
System.out.println("item is ascending or not : " + item.isAscending());
}

The type of "item" must be SortItem and this gets you want u want. Should have waited a bit before asking on the forum but either way, maybe it'll help somebody some day.
thx anyways.
gabrielaradu
 
Posts: 2
Joined: Mon Aug 02, 2010 4:27 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 69 guests