3.0 beta 2

Grid remembers selected rows even after refresh

When I call setUrl to refresh my data, the grid remembers which rows where selected before the refresh and highlights the same rows after the refresh. I don't think this is a good thing!

How can I make sure that all rows are "unselected" when I refresh the data?
March 3,

the grid keeps its state in a set of data models/properties independent of the HTML structure. You should be able to re-create HTML at any time calling 'toString' method (as 'refresh' method does). So calling 'refresh()' should not change control state.

To clear the selected row(s) you can just do

obj.setProperty("selection/index", -1);
Alex (ActiveWidgets)
March 4,

thanks for the tip. I will make sure I unselect the row but I do think that this should be the default behavior since when refresh is called, new data may be fetched and displayed on the grid and keeping the state does not make sense. What if row 9 was selected before the refresh and only 5 rows are present in the grid after the refresh?
March 4,
The data model should not only call refresh method on the grid, but clear the selection when the new data is fetched?
Alex (ActiveWidgets)
March 9,
I understand your desire to keep the different model seperate and I don't want to be telling which model should be doing what. All I'm saying is that it doesn't make sense for the rows to be selected after a refresh if we know that the refresh can cause the data to be different.
March 13,

This topic is archived.

See also:

Back to support forum


Version 2

Looking for AW 2.6 ?
The old site is here.