I have put the below code on my dataSource. It is inserting the data into the dataSource like it should but the row does not show up on the grid unless I do something on the grid like changing the sort. Do I need to re-sync the grid with the dataSource? If so how do I do that?
change: function (e) {
if (e.action == "add") {
var newItem = e.items[0];
if (this.filter() != undefined) {
var filter = this.filter().filters;
var i = filter.length;
while (i--) {
filterValue = filter[i].value;
filterField = filter[i].field;
switch (filterField) {
case "product.textField":
newItem.product.textField = filterValue;
break;
case "product.valueField":
newItem.product.valueField = filterValue;
break;
default:
newItem[filterField] = filterValue;
}
}
}
}
}
thx!