Nov 25, 2019, 7:10 AM
MVC GridPanelFor example with batch update
Hi,
does anybody have an example of using batch update with GridPanelFor.
I've followed this example: Grid with batch saving
But don't know how to get the store of the GridPanel.
I've tried the following without success as panel.GetStore() returns null:
Thanks in advance
Ian
does anybody have an example of using batch update with GridPanelFor.
I've followed this example: Grid with batch saving
But don't know how to get the store of the GridPanel.
I've tried the following without success as panel.GetStore() returns null:
public ActionResult HandleItemChanges(StoreDataHandler handler)
{
var panel = (this.GetCmp<GridPanel>("PricePanel"));
var store = panel.GetStore();
foreach (SubscriptionItem created in items.Created)
{
var record = store.GetByInternalId(created.PhantomId);
record.CreateVariable = true;
record.SetId(created.ItemId);
record.Commit();
created.PhantomId = null;
}
foreach (SubscriptionItem deleted in items.Deleted)
{
store.CommitRemoving(deleted.OldItemId.Value);
}
foreach (SubscriptionItem updated in items.Updated)
{
var record = store.GetById(updated.OldItemId);
record.Commit();
}
return this.Direct();
}
Can anyone advise how to commit the changed store records?Thanks in advance
Ian