Quantcast

Sorting a jtable using a hidden column

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Sorting a jtable using a hidden column

amolle
Hi all,

I would like to sort my JTable using a column wihich is not always visible.. (<=> not in the sortedlist given to my tableformat)
Has anyone tried to do this ?

a.m
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting a jtable using a hidden column

James Lemieux
Amelie,

   If the sort should always occur and can never be altered, you need to either:

a) ensure you use compound Comparators that consider your hidden column's values

or

b) stack 2 SortedLists in your pipeline. The first one honors the static (hidden column) sort. The 2nd one breaks sorting ties using the column selections the user makes (via the normal TableComparatorChooser mechanism).

b) is trivial to implement, though it will require more memory and introduce another layer to your pipeline.

On Wed, Dec 14, 2011 at 5:36 AM, amolle <[hidden email]> wrote:
Hi all,

I would like to sort my JTable using a column wihich is not always visible..
(<=> not in the sortedlist given to my tableformat)
Has anyone tried to do this ?

a.m


--
View this message in context: http://glazedlists.1045722.n5.nabble.com/Sorting-a-jtable-using-a-hidden-column-tp5074482p5074482.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.

Loading...