Printable View
Hi @thesvr,
Welcome to the Ext.NET forums!
Currently, a sync method returns undefined. "!undefined" gets true in JavaScript. Therefore you see "test2" every time.
I tested a callback. It works well for me. Please clarify can't you see a "test1" message at all?
Now in Ext.NET 2 and ExtJS 4, a response must contain saved records. Please look at this example.
https://examples2.ext.net/#/GridPanel/Update/AutoSave/
Indeed I don't get a "test 1" alert.
I looked at the example, to me it looks like it just handles exeptions and no success.
I also implemented the callback in the example using:
In modified the example I also don't get an alert.Code:<Click Handler="#{Store1}.sync({
callback: function(records, operation, success) {
alert('test');
}
}
);" />
The issue with callback was fixed in 2.1 version
I suggest to update from 2.1 branch and retest
Hi it works for me using 2.1 branch and the function bellow. However I run into some other issues using the 2.1 branch. That makes me wonder if the 2.1 branch is suitable for a production environment?
Code:var savestore = function (store) {
var g = store.getNewRecords(), d = store.getUpdatedRecords(), a = store.getRemovedRecords();
if (g.length > 0 || d.length > 0 || a.length > 0) {
store.sync({
callback: function (records, operation) {
alert('synced');
}
});
}
else {
alert('nothing to sync');
}
}
Yes, branch 2.1 is quite stable and will be released soon
Can you describe the issues? We will be glad to fix it asap
Okay I expected this answer so I am working on the migration to 2.1. Here are the issues I am currently working on:
1. Model datetime format
Using Ext.net 2.0 i used M$ as dateformat in my model for date field. In 2.1 are these send back as "\date\" format. This resulted in difficulties to process at the webservice.
Usingas dateformat solved the issue. Looks like: http://forums.ext.net/showthread.php...c-Date-ProblemCode:yyyy-MM-dd\\THH:mm:ss
During the debugging I saw the advantages of ISO 8601. It offers an ability to eliminate timezone issues by using an UTC time in the format 2011-01-01T00:00:00.0000000Z (). For now I could not find an easy way to configure the model to use this format (especially the conversion to UTC).Code:.ToString("O")
2. Partial view is not completely destroyed
I have got a partial view in a tabpanel. When closing the tab the content is not destroyed when usingduring it's creation. However when usingCode:Ext.Net.RenderMode.RenderTo
it works.Code:Ext.Net.RenderMode.Auto
3. RESTProxy, JSONreader /writer and root setting
I have trouble reading and writing JSON when setting Root property in a REST proxy. When I removed the data level in store and JSON it works. When removing the data layer in JSON it looks as-well. So it looks like if the Root setting is ignored.
My store simplified:
Code:.Store(store => store.Add(Html.X().Store()
.PageSize(100)
.ID("testStore")
.Proxy(proxy => proxy.Add(
Html.X().RestProxy()
.Url(Url.Action("API", "api"))
))
.Reader(reader =>
Html.X().JsonReader()
.IDProperty("row_id")
.Root("data")
.SuccessProperty("success")
.MessageProperty("message")
)
.Model(model => model.Add(Html.X().Model()
.Fields(fields =>
{
fields.Add(Html.X().ModelField().Name("test"));
})
))
))
There are a ModelField's DateWriteFormat and a Write's DateFormat options.
http://docs.sencha.com/ext-js/4-1/#!...ateWriteFormat
http://docs.sencha.com/ext-js/4-1/#!...cfg-dateFormat
We think they could help.
Could you, please, start new forums threads with samples to reproduce? We will appreciate.