Hi,
I am trying to preselect some records, when the grid is rendering. I am using a Paged List Grid bound to a SQL datasource. I have rewritten preselection logic in the addDataArrivedHandler. But it never works. Neither on first time load nor or user scroll. But if i filter data it works.
Below is the code snippet:
listGrid.addDataArrivedHandler(handler -> {
if (null != alreadySelectedValues && !alreadySelectedValues.isEmpty()) {
final List<ListGridRecord> matchedRecords = Arrays.stream(listGrid.getRecords())
.filter(rec -> alreadySelectedValues.contains(rec.getAttribute("name"))).map(ListGridRecord::new).collect(Collectors.toList());
listGrid.selectRecords(matchedRecords.toArray(new ListGridRecord[0]));
}
});
Smart GWT version: 12.1-p20200709
I am trying to preselect some records, when the grid is rendering. I am using a Paged List Grid bound to a SQL datasource. I have rewritten preselection logic in the addDataArrivedHandler. But it never works. Neither on first time load nor or user scroll. But if i filter data it works.
Below is the code snippet:
listGrid.addDataArrivedHandler(handler -> {
if (null != alreadySelectedValues && !alreadySelectedValues.isEmpty()) {
final List<ListGridRecord> matchedRecords = Arrays.stream(listGrid.getRecords())
.filter(rec -> alreadySelectedValues.contains(rec.getAttribute("name"))).map(ListGridRecord::new).collect(Collectors.toList());
listGrid.selectRecords(matchedRecords.toArray(new ListGridRecord[0]));
}
});
Smart GWT version: 12.1-p20200709
Comment