|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
How to sort rows by a column through code?Hi all,
I am supposed to add some more to the existing code that makes use of GL and JXTable. I must say they are like, made for each other. When user double clicks on a column-header the rows in the table get sorted in ascending / descending order. And when user (single) clicks on a column header the rows of that column are sorted. Everything works just great. Now, all I need to do is sort the rows in the table by first column (as the primary sort) and then by the second column (as the secondary sort) through code before user gets to see the table. (Default sorting to serve the user better..) So I believe I have to use some sort keys or something like this : http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#sorting ? I also searched nabble for some solutions and stumbled upon the following thread : http://www.nabble.com/EventListJXTableSorting-td11801610.html#a23574421 I was hoping this would be straight forward and easy.. But haven't found a solution yet.. I'd really appreciate if someone could provide me with some hints / solution or point me to the right direction. Thanks. |
|
|
Re: How to sort rows by a column through code?Any replies please...
All I want to do is sort the jxtable by a particular column through code before user gets to see the table. Anticipating some response. Thanks. |
|
|
re[2]: How to sort rows by a column through code?This should get you started:
Be sure to understand that the sorting GL occurs in the list pipeline itself - not in the table model.
There are some specifics about using GL with JXTable (I don't have them handy, but you might want to search the GL site or listserv archives for 'JXTable' and see what you find).
- K
----------------------- Original Message -----------------------
From: kaprasi kaprasannagt@...
To: users@...
Cc:
Date: Thu, 17 Sep 2009 03:28:34 -0700 (PDT)
Subject: Re: How to sort rows by a column through code?
Any replies please... All I want to do is sort the jxtable by a particular column through code before user gets to see the table. Anticipating some response. Thanks. -- View this message in context: http://www.nabble.com/How-to-sort-rows-by-a-column-through-code--tp25454154p25488718.html Sent from the GlazedLists - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: re[2]: How to sort rows by a column through code?Thanks for the help but I had gone through the GL tutorial long before I posted the thread.
It hadn't helped me a bit. Now, I believe I have kind of found a solution for now by providing a comparator which uses values in 1st column. And by commenting out the following line : //ca.odell.glazedlists.swing.EventListJXTableSorting.install(jXTable1,sortedList); I am just hoping this won't break something else. If at all there are any developments in this regard I expect someone will write a line or two about it here. Thanks.
|
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |