Code:
<html>
<head>
<title>IE Store Test</title>
<!-- Style Sheets -->
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<!-- JavaScript Libraries -->
<script type="text/javascript" src="/js/ExtJS/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/js/ExtJS/ext-all.js"></script>
<!-- Main Code -->
<script type="text/javascript">
Ext.BLANK_IMAGE_URL = '/img/ExtJS/default/s.gif';
var storeExceptionHandler = function(prox, type, act, opts, resp, args)
{
var loc = '';
if (prox.url)
{
loc = ' : ' + prox.url;
}
else if (prox.api && prox.api[act] && prox.api[act].url)
{
loc = ' : ' + prox.api[act].url;
}
var title = 'Failed ('+ act + loc +')';
if (type == 'response')
{
if (resp.message)
{
Ext.Msg.alert(title, resp.message);
}
else if (resp.responseText)
{
Ext.Msg.alert(title, resp.responseText);
}
else
{
Ext.Msg.alert(title, 'An invalid response was received from the server');
}
}
else if ( (type == 'remote') && resp.message )
{
Ext.Msg.alert(title, resp.message);
}
else
{
Ext.Msg.alert(title, 'Unknown Error');
}
};
var myStore = new Ext.data.JsonStore
({
autoDestroy:true
,autoLoad:false
,url:'/test/_testData.json'
,root:'data'
,successProperty:'success'
,messageProperty:'message'
,totalProperty:'total'
,idProperty:'field_01'
,sortInfo:
{
field:'field_34'
,direction:'ASC'
}
,fields:
[
{
name:'field_01'
,type:'int'
}
,{
name:'field_32'
,type:'string'
}
,{
name:'field_33'
,type:'string'
}
,{
name:'field_34'
,type:'string'
}
,{
name:'field_05'
,type:'string'
}
,{
name:'field_07'
,type:'string'
}
,{
name:'field_09'
,type:'string'
}
,{
name:'field_08'
,type:'string'
}
,{
name:'field_35'
,type:'string'
}
,{
name:'field_36'
,type:'string'
}
,{
name:'field_38'
,type:'string'
}
,{
name:'field_39'
,type:'string'
}
,{
name:'field_19'
,type:'string'
}
,{
name:'field_21'
,type:'string'
}
,{
name:'field_23'
,type:'date'
,dateFormat:'Y-m-d'
}
,{
name:'field_25'
,type:'date'
,dateFormat:'Y-m-d'
}
,{
name:'field_26'
,type:'string'
}
,{
name:'field_27'
,type:'string'
}
,{
name:'field_30'
,type:'date'
,dateFormat:'Y-m-d'
}
,{
name:'field_40'
,type:'string'
}
]
,listeners:
{
exception:storeExceptionHandler
,load:function()
{
alert('loaded');
}
}
});
Ext.onReady
(
function()
{
myStore.load();
}
);
</script>
</head>
<body>
Should see an alert when store is loaded.
</body>
</html>
test data attached.