PDA

View Full Version : [CLOSED] MVC Grid Editing



adelaney
May 22, 2012, 8:33 PM
In MVC, how do I create an editor that automatically updates a record via the proxy information? I am using the rowEditor plugin and I do see the row with the red clip in the corner after pressing "Update," but I don't know how to "post" that update. I do have a proxy reader and writer configured, but my grid is not within a form. For reference, here is my proxy config:


.Store(Sub(store)
store.Add(Html.X.Store.Proxy(Sub(prxy)
Dim prx As New Ext.Net.AjaxProxy
With prx
.ActionMethods.Read = HttpMethod.POST
.API.Read = Url.Content("~/Assignments/_GetCedentAutoList")
.API.Update = Url.Content("~/Assignments/_EditTeam")
.Reader.Add(New Ext.Net.JsonReader() With {.Root = "Data"})
.Writer.Add(New Ext.net.Jsonwriter() with {.Root="Data"})
End With
prxy.Add(prx)
End Sub).AutoLoad(False).Model(Sub(mdl)
mdl.Add(Html.X.Model.ClientIdProperty("Value").Fields(Sub(flds)
flds.Add(Html.X.ModelField().Type(ModelFieldType.S tring).Name("Value"))
flds.Add(Html.X.ModelField().Type(ModelFieldType.S tring).Name("Text"))
End Sub))
End Sub))
End Sub)

Daniil
May 23, 2012, 10:49 AM
Hi,

You can:

1. Set up

AutoSync="true"
for the Store.
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.AbstractStore-cfg-autoSync

2. Or call the Store sync method.
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.AbstractStore-method-sync