Ext grid数据加载异常一般是以下几个原因导致:
1.需要加载的数据格式错误。比如以json方式加载的数据,如果json字符串格式错误,就会导致数据无法加载。
2.如果store定义了baseParams参数,在定义store时需要给baseParams赋初始值,否则store在自动加载时会出现异常导致数据无法加载。
var store = new Ext.data.Store({
proxy: proxy,
reader: reader,
autoLoad: true,
baseParams:{type:'unselect'},
listeners:{
exception : function(proxy, type, action, options, response, arg ){
……
}
}
});
如果数据无法加载,可以在store中增加exception实践,打出异常日志进行调试。