页面js部分的写法
- new Ext.data.Store({
- proxy : new Ext.data.HttpProxy({
- url : basePath + '/fundAuditAction.do'
- }),
- reader : new Ext.data.JsonReader({
- totalProperty : 'total',
- root : 'root',
- successProperty : 'succeed',
- fields : [...]
- })
- ,successProperty: 'success' // 后台传输的标识。必须
- ,listeners:{
- exception:function(dataProxy, type, action, options, response, arg) {
- var o = Ext.util.JSON.decode(response.responseText);
- if(!o.success){
- Ext.Msg.alert('错误提示',o.message);
- }
- }
- }
- });
后端产生异常时,发送json串
- "{success: false, message:'"+msg+"'}"