日期:2014-05-19  浏览次数:20691 次

Ext this.store为空或不是对象
是这样的一个问题,添加成功之后报this.store为空或不是对象,编辑成功之后也报这个问题,我不知道是什么问题?可以帮忙看看吗?代码贴出来给大家看看。var InspectDept=Ext.data.Record.create([
 {name : 'ID',mapping : 'PK_INSPECTDEPT_ID',type : 'int'}, 
 {name : 'attribute1', mapping : 'attribute1',type : 'string'}, 
 {name : 'attribute2',mapping : 'attribute2',type : 'string'}, 
 {name : 'attribute3',mapping : 'attribute3',type : 'string'}, 
 {name : 'attribute4',mapping : 'attribute4',type : 'string'}, 
 {name : 'attribute5',mapping : 'attribute5',type : 'string'}, 
 {name : 'isEntrustDept',mapping : 'isEntrustDept',type : 'string'}, 
 {name : 'createDate', mapping : 'createDate',type : 'string'}, 
 {name : 'deptCode',mapping : 'deptCode',type : 'string'}, 
 {name : 'deptName', mapping : 'deptName',type : 'string'}, 
 {name : 'lastModifyBy',mapping : 'lastModifyBy',type : 'string'}, 
 {name : 'lastModifyDate',mapping : 'lastModifyDate',type : 'string'},  
 {name : 'remark',mapping : 'remark',type : 'string'}
]);

var ds_inspectDept = new Ext.data.Store({
 url : 'showListInspectDept.action',
 reader : new Ext.data.JsonReader(
  {totalProperty : 'totalProperty',root : 'root'}, 
    [
     {name : 'ID',type : 'int'}, //编号
  {name : 'deptCode',type : 'string'}, //编号
  {name : 'deptName',type : 'string'}, //部门名称
  {name : 'isEntrustDept',type : 'string'},//是否委托单位
  {name : 'remark',type : 'string'}//备注
    ])
});
var record_start=0;
var sm_InspectDept=new Ext.grid.CheckboxSelectionModel();
var cm_inspectDept = new Ext.grid.ColumnModel([sm_InspectDept,
    new Ext.grid.RowNumberer({
    header : "序号",
    width : 40,
    renderer:function(value,metadata,record,rowIndex){
     return record_start + 1 + rowIndex;
    }
  }),
 {header : '编号',width : 40, dataIndex : 'deptCode',sortable : true}, 
 {header : '部门名称',width : 50, dataIndex : 'deptName',sortable : true}, 
 {header : '是否委托单位',width : 60,dataIndex : 'isEntrustDept',sortable : true}, 
 {header : '备注', width : 90, dataIndex : 'remark',id : 'remark',sortable : true}]
);

 

var btn_add_InspectDept = new Ext.Button({
 text : '添加部门',
 iconCls : 'icon-add',
 handler : function() {
  window_add_InspectDept.show();
 }
});
var AddInspectDeptForm = new Ext.FormPanel({
 url : 'saveInspectDept.action',
 labelAlign : 'left',
 labelWidth : 100,
 bodyStyle : 'padding:5px'