PDA

View Full Version : [CLOSED] Store Proxy Failure event handler definition



registrator
Apr 15, 2015, 12:53 PM
I have this store for a combo box.


.Store(X.Store()
.ID("AccountComboStore")
//.AutoLoad(true)
.Model(
X.Model()
.Name("BankAccountForCombo")
.IDProperty("REF")
.Fields(
X.ModelField()
.Name("NAME")
.Type(ModelFieldType.String)
)
)
.Proxy(Html.X().AjaxProxy()
.Url(Url.Action("GetBankAccountList", "List", new { area = "lRecord" }))
.Reader(Html.X().JsonReader().Root("data"))
)
),


I would like to handle the event of Failure to load the data but could not find how is it defined?

Thank you

Daniil
Apr 15, 2015, 4:15 PM
Hi @registrator,

There is a successful flag passed to a Store's Load event.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.data.AbstractStore-event-load

registrator
Apr 15, 2015, 10:41 PM
Can you get a result back?
To define something like:



App.EditWindow.load({
url: callurl,
params: {
id: recordId
},
success: function (result) {
if (result.responseText == '{"success":false,"errorMessage":"Unauthorized","result":"Login"}') {

};
}
});

Daniil
Apr 16, 2015, 6:51 AM
In this case it is better to use a Store's Exception handler. A response is passed to its handler.