vitaly2020
Mar 15, 2020, 10:26 AM
Hello!
I have a gridpanel to change data in db:
X.GridPanel()
.ID("GridPanel1")
.Title("Expander Rows with control")
.Icon(Icon.Table)
.Width(800)
.Store(Html.X().StoreForModel().ID("Store1").AutoSync(true).ShowWarningOnFailure(false)
.Listeners(l =>
{
l.Exception.Fn = "onStoreException";
l.Exception.Buffer = 10;
})
.SyncUrl(Url.Action("HandleChanges"))
)
.ColumnModel(
Html.X().ColumnFor(Model, m => m.id)
.ToBuilder<Column.Builder>()
.Text("ID")
.Width(50),
i change data and correct it in database by update handler:
public ActionResult HandleChanges(StoreDataHandler handler)
{ List<Requests> readyTask = handler.ObjectData<TestMVC.Models.Requests>();
if (handler.Action == StoreAction.Update)
{ manipulations with db }
return (ActionResult)this.Store(data);
In my DB all changes gone OK, how i can update my grid (after that update some rows must gone, because model data will not grab they in query).
For test i create a button (refresh btn:) ) with handler: this.up('grid').getView().refresh();
after refresh updated row dissaper, BUT grid have a same count of rows (with doble rows)
I have a gridpanel to change data in db:
X.GridPanel()
.ID("GridPanel1")
.Title("Expander Rows with control")
.Icon(Icon.Table)
.Width(800)
.Store(Html.X().StoreForModel().ID("Store1").AutoSync(true).ShowWarningOnFailure(false)
.Listeners(l =>
{
l.Exception.Fn = "onStoreException";
l.Exception.Buffer = 10;
})
.SyncUrl(Url.Action("HandleChanges"))
)
.ColumnModel(
Html.X().ColumnFor(Model, m => m.id)
.ToBuilder<Column.Builder>()
.Text("ID")
.Width(50),
i change data and correct it in database by update handler:
public ActionResult HandleChanges(StoreDataHandler handler)
{ List<Requests> readyTask = handler.ObjectData<TestMVC.Models.Requests>();
if (handler.Action == StoreAction.Update)
{ manipulations with db }
return (ActionResult)this.Store(data);
In my DB all changes gone OK, how i can update my grid (after that update some rows must gone, because model data will not grab they in query).
For test i create a button (refresh btn:) ) with handler: this.up('grid').getView().refresh();
after refresh updated row dissaper, BUT grid have a same count of rows (with doble rows)