I am using Extjs 6.5.3 classic toolkit. I am having store for grid. I want to handle store load exceptions. How can I handle this?
My store is like this:
Ext.define('RUI.store.ProjectListStore', {
extend: 'Ext.data.Store',
sortOnLoad: false,
pageSize:RUIRamboConstants.DEFAULT_PAGE_SIZE,
proxy : {
type : 'ajax',
actionMethods: {
read: 'POST'
},
url: 'api.do',
reader: {
rootProperty: 'List',
type: 'json',
isURLConvert : true,
totalProperty: 'TotalRecords',
}
}
});
I get following response from server:
{
"limit": 10,
"page": 1,
"start": 0,
"TotalRecords": 2,
"userFilterId": 0,
"List": [
{
"id": 1,
"name" : "abc"
},
{
"id": 1926722,
"name" : "xyz"
}
]
}
When failure:
{
"returnCode": 1,
"messageKey": null,
"detailedMessage": null,
"exception": null,
"browser": "Mozilla 5.0 (Windows)",
"customParams": null,
"errorMessages": [
{
"messageKey": "duplicate",
"detailedMessage": "Duplicate."
}
],
"success": false
}
I want to catch this failure and want to show message as "Duplicate".
Please help!!
Thank you in advance.