View Full Version : Handling exception while Store.LoadPage()

16 Sep 2012, 9:51 PM
Hi all,

I am using ExtJs 4.1 framework.

I have a grid which is associated with a store.

var store = new Ext.create('Ext.data.ArrayStore', {
id: gridStoreId,
autoLoad: false,
buffered: false,
pageSize: 200,
fields: resultFields,
remoteSort: true,
proxy: Ext.create(PA.common.EXTAjax, {
msgBody: jsonStr,
type: 'ajax',
url: '/test/getdata',
actionMethods: {
create: 'POST',
read: 'POST',
update: 'POST',
destroy: 'POST'
reader: {
root: 'MyResult.Data',
type: 'array',
totalProperty: 'RowCount'
}) //End of proxy

I load the store using store.loadPage(1) method. At times, I get invalid json response or response comes as null or server throws an exception. If I get invalid or null response, system generates a javsscript error.
I have added try catch block around the store.loadPage(1), but catch block does not catch the error.

I want to understand if there is any inbuilt event for handling such scenarios? Like for every ajax request we have success and failure callback function.
What is the best way to handle such situation
Please provide your suggestions.

17 Sep 2012, 5:53 AM

you can check this link: http://www.sencha.com/forum/showthread.php?143872-Catching-data-store-exception-in-ExtJS-4

17 Sep 2012, 10:46 PM
Hey Sword-IT,

Thank you for the reply. This is exactly what I was looking for !!!:D