-
update grid data
Hello!
I have a gridpanel to change data in db:
Code:
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:
Code:
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)
-
Hello, @vitaly2020!
I fear I will have to repeat myself with the last response we provided you. We need a test case.
Just for reference, these are the links for guidelines on posting helpful threads (helpful in the concept of threads where you "help us help you"):
- Tips for creating simplified code samples
- More Information Required
- Forum Guidelines
We should not repeat this for you, sorry for the inconvenience. We honestly looked up your sample but couldn't get anything that suggests a reason for the double rows you are getting from the sync result.
Hope you understand.