This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Sorting on 3 fields and want to only reset 1

 
Tom Landry
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Currently sorting my JTable on 3 different columns.
Able to reset all sorting columns by setting my sorter to null, but really just want to reset the 3rd column used for sorting so that only two columns are used instead of 3.
Is there a way to "unset" a specific column from the list of sorting columns?
 
Rob Camick
Ranch Hand
Posts: 2703
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the DefaultRowSorter class.

You should be able to use the getSortKeys() method, remove the last item in the List and then use the setSortKeys() method.
 
Tom Landry
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for taking the time to reply, but by the time i went to research the info for this it became a moot point as I didn't need it anymore. ;-)
I will definitely play around with it as time permits.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!