PDA

View Full Version : [CLOSED] Proxy Writer Undefined



ehmdb
Aug 13, 2013, 4:24 PM
I have simple gridpanel/form that updates the database with user input, and retrieves updated data from db (primary key, update date, etc.). Pattern follows http://mvc.ext.net/#/GridPanel_Update/AutoSave/ and is modified to save to DB.

I have tried the following three proxy syntax methods - all give me "Please define Writer for the Proxy (store's Writer is used if proxy is undefined)" in OnBeforeClientInit (line 48) of SyncStoreBase.cs

// method 1

//.Proxy(proxy => proxy.Add(X.AjaxProxy()
// .BatchActions(true)
// .API(api => { api.Sync = "HandleFeatureChanges"; api.Read = "GetFeatureRecords"; })
// .Reader(reader => reader.Add(X.JsonReader()
// .Root("data")
// ))
// .Writer(writer => writer.Add(X.JsonWriter()
// .Root("data")
// .Encode(true)
// ))
// ))

// method 1.5

.Proxy(proxy =>
proxy.Add(new AjaxProxy()
{
API =
{
Read = "GetFeatureRecords",
Sync = "HandleFeatureChanges"
}
})
)

// method 2

//.Proxy(X.AjaxProxy()
// //.Url(Url.Action("GetFeatureRecords"))
// .ActionMethods(am => am.Read = HttpMethod.POST)
// .Reader(X.JsonReader().Root("data"))
// //.Writer(w => w.Add(X.JsonReader().Root("data")))
// .API(api =>
// {
// api.Read = "GetFeatureRecords";
// api.Sync = "HandleFeatureChanges";
// })
//)
//.AutoSync(true)
//.ShowWarningOnFailure(true)
//.Listeners(l =>
//{
// l.Exception.Fn = "onStoreException";
//})

please advise.

Baidaly
Aug 14, 2013, 1:52 AM
Hello!

Sorry, can you provide how you declare the store or a full sample to reproduce?

Also, this post can be helpful: http://forums.ext.net/showthread.php?18243&p=78866&viewfull=1#post78866