onDataSourceSuccess method
Implementation
@override
Future<bool> onDataSourceSuccess(IDataSource source, Data? list) async {
busy = true;
int i = 0;
if (list != null)
{
clean = true;
// clear items
this.items.forEach((_,item) => item.dispose());
this.items.clear();
// Populate grid items from datasource
list.forEach((row) {
XmlElement? prototype = S.fromPrototype(this.prototype, "${this.id}-$i");
var model = GridItemModel.fromXml(parent!, prototype, data: row);
if (model != null) items[i++] = model;
});
notifyListeners('list', items);
}
busy = false;
return true;
}