Selection of rows in SortableTable when rows are removed

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.

Selection of rows in SortableTable when rows are removed

Postby ack1035 » Tue Aug 12, 2008 7:39 am

Hello,
I have an application with a SortableTable that allows both for users to remove rows from the table, and for rows to be removed programmatically. In both cases the removed item is selected (highlighted) before removal. After removal, however, behavior depends on if the table is sorted:

- if the table is unsorted, the next item in the table becomes selected

- if the table is sorted, some item elsewhere in the table becomes selected (corresponding to the row that would have been selected if the table had not been sorted).

I would like either for no item to be selected when the selected row is removed, or for the next row to be selected no matter what sorting is used. Is either behavior possible? Thanks.
ack1035
 
Posts: 11
Joined: Tue Jun 10, 2008 10:02 am

Re: Selection of rows in SortableTable when rows are removed

Postby JIDE Support » Tue Aug 12, 2008 7:50 am

Can you please try SortableTable#setOptimized(true) to see what the behavior is?

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Selection of rows in SortableTable when rows are removed

Postby ack1035 » Tue Aug 12, 2008 8:07 am

That fixed it - now no row is selected after the selected row is removed.

Thanks!
ack1035
 
Posts: 11
Joined: Tue Jun 10, 2008 10:02 am

Re: Selection of rows in SortableTable when rows are removed

Postby yuy527 » Wed Nov 28, 2012 8:16 am

use
sortableTable.clearSelection();
this is much "clear" :D
yuy527
 
Posts: 1
Joined: Wed Nov 28, 2012 8:10 am

Re: Selection of rows in SortableTable when rows are removed

Postby ioan » Thu Jan 22, 2015 4:05 am

Hi,

My issue is of the same kind:
I want to slect the next selectedRow in a SortableTable but if the table is sorted the next selectedRow is not anymore table.getSelectedRow() + 1.
How can i get the index of the next row to be selected (before or after the slected one).

Thanks
ioan
 
Posts: 73
Joined: Thu Oct 25, 2012 5:13 am

Re: Selection of rows in SortableTable when rows are removed

Postby JIDE Support » Thu Jan 22, 2015 10:02 am

The selection is a "view" thing. It has nothing to do with the table is sorted or not. So if you have a row selected and you want to select the next row, it is still the next row table.getSelectedRow() + 1. If you want to get the actual row index as in the model from the visual row index, use TableModelWrapperUtils.getActualRowAt method.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


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

Who is online

Users browsing this forum: Google [Bot] and 10 guests