SmartClient Version: v9.1p_2014-07-13/LGPL Development Only (built 2014-07-13)
I have a case where I am getting selection behavior in the grid that I did not expect. I don't know if this is a defect or if my expectations are incorrect or if there are settings that might allow me to control this behavior.
Sample code is attached. You should be able to load this control into a page and see the behavior.
I have a grid with a filter attached to it. I also have asynchronous server events causing updates to the data source backing the grid.
If a record is selected in the grid and I update the data for that record such that it no longer matches the filter, the record disappears from the grid, but if there is a record after it in the grid, that record becomes selected.
Using the sample code, select the record in the grid with ID "0" (the sample code selects this record automatically for you), the press the "Update selected record button" (this simulates my background server events that update the data source). This will modify the grid data such that record "0" no longer matches the criteria. Upon doing this, you will see record "0" removed from the grid display, and now record "1" is selected. I was expecting that no records would be selected after this and that a selection change event would fire.
If you select record "1" instead you will see similar behavior, but record ID "2" will be selected after the update.
If a selected record in the grid gets filtered out after an update, I would expect it to drop from the grid's selected record list without any new records being selected and a selection change event to be fired. It does not seem like correct behavior to me that filtering a record on update would cause a new record in the grid to get selected when the user did not select that record.
I have a case where I am getting selection behavior in the grid that I did not expect. I don't know if this is a defect or if my expectations are incorrect or if there are settings that might allow me to control this behavior.
Sample code is attached. You should be able to load this control into a page and see the behavior.
I have a grid with a filter attached to it. I also have asynchronous server events causing updates to the data source backing the grid.
If a record is selected in the grid and I update the data for that record such that it no longer matches the filter, the record disappears from the grid, but if there is a record after it in the grid, that record becomes selected.
Using the sample code, select the record in the grid with ID "0" (the sample code selects this record automatically for you), the press the "Update selected record button" (this simulates my background server events that update the data source). This will modify the grid data such that record "0" no longer matches the criteria. Upon doing this, you will see record "0" removed from the grid display, and now record "1" is selected. I was expecting that no records would be selected after this and that a selection change event would fire.
If you select record "1" instead you will see similar behavior, but record ID "2" will be selected after the update.
If a selected record in the grid gets filtered out after an update, I would expect it to drop from the grid's selected record list without any new records being selected and a selection change event to be fired. It does not seem like correct behavior to me that filtering a record on update would cause a new record in the grid to get selected when the user did not select that record.
Comment