Hi,
I'm using SmartGWT 4.0p and I encountered the following problem. My ListGrid has been configured to work in 'Single Selection' mode. However, when I call selectRecord(record) the selection is added to the current selection, which is inconsistent ... IMO, the current selection should be discarded (and an event fired), then the specified record should be selected.
Here is a small example which illustrates the problem and a screenshot:
Thanks,
Edit:
I found that I should use selectSingleRecord(record) instead. So it's ok for me! But again for consitency, I would perhaps advise to redirect the selectRecord() call to selectSingleRecord() when the selection type is set to Single :-).
Thanks Anyway !
Thomas
I'm using SmartGWT 4.0p and I encountered the following problem. My ListGrid has been configured to work in 'Single Selection' mode. However, when I call selectRecord(record) the selection is added to the current selection, which is inconsistent ... IMO, the current selection should be discarded (and an event fired), then the specified record should be selected.
Here is a small example which illustrates the problem and a screenshot:
Code:
final ListGrid test = new ListGrid(DataSource.get("sys_configuration")); test.setSelectionType(SelectionStyle.SINGLE); test.setAutoFetchData(true); test.setWidth100(); test.setHeight100(); test.addDataArrivedHandler(new DataArrivedHandler() { @Override public void onDataArrived(DataArrivedEvent event) { test.selectRecord(0); test.selectRecord(1); // this one should force record 0 to be unselected } }); test.draw();
Edit:
I found that I should use selectSingleRecord(record) instead. So it's ok for me! But again for consitency, I would perhaps advise to redirect the selectRecord() call to selectSingleRecord() when the selection type is set to Single :-).
Thanks Anyway !
Thomas
Comment