3.2.0

Setting the selected row in a list

I am using
list.setSelectedItems([])
to set which row is selected in a list. It seems to be working fine, but it is leaving a grey row where ever the selected row originally was.

For example, my list contains 5 rows. If I select row 5 it becomes blue. Then programaticly with the above code I select row 4. Now row 4 becomes blue, but row 5 is now grey. If I then select row 3, row 3 becomes blue and 5 is still grey.

Anybody know what I'm missing?

Thanks
Aaron Todd
October 19,
try with list.refresh()
and then set the selected row

just an idea
Markus Schostok, Germany
October 19,
I am actually doing a refresh right before I select the row. Trying after as well did nothing.
Aaron Todd
October 19,
You should set both selectedItems and currentItem (which might be different in case of multi-select model). -

obj.setSelectedItems([i]);
obj.setCurrentItem(i);
Alex (ActiveWidgets)
October 19,
Alex,

Thats exactly what I needed, however for my implementation I had to set the currentItem before the SelectedItems.
Aaron Todd
October 19,

This topic is archived.

See also:


Back to support forum