PDA

View Full Version : update grid data



vitaly2020
Mar 15, 2020, 11: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)

fabricio.murta
Mar 16, 2020, 10:40 PM
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 (http://forums.ext.net/showthread.php?61176-Tips-for-creating-simplified-code-samples)
- More Information Required (http://forums.ext.net/showthread.php?10205-More-Information-Required)
- Forum Guidelines (http://forums.ext.net/showthread.php?3440-Forum-Guidelines-For-Posting-New-Topics)

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.