87,910
社区成员
发帖
与我相关
我的任务
分享
systemConfigJsonStore = Ext.extend(Ext.data.JsonStore, {
constructor : function() {
systemConfigJsonStore.superclass.constructor.call(this, {
url : "systemConfig/SystemConfigOper!findSystemConfig.action",
root : 'root',
totalProperty : 'totalProperty',
fields : [{
name : "id"
}, {
name : "systemConfigName"
}, {
name : "systemConfigValue"
}, {
name : "systemConfigInfo"
},{
name:'editorValue'
},
{
name:'defaultValue'
}
]
,autoLoad :true
});
}
});
systemConfigGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
configStore:null,
constructor : function() {
configStore=new systemConfigJsonStore();
var cm = new Ext.grid.ColumnModel([
{
header : "系统信息名称",
sortable : true,
dataIndex : 'systemConfigName'
}, {
header : '系统信息值',
dataIndex : 'systemConfigValue',
sortable : true/*,
editor: new Ext.form.Field({
allowBlank: false,
allowNegative: false,
maxValue: 100000
})
*/
},
{
header : '系统信息说明',
dataIndex : 'systemConfigInfo',
sortable : true
}
]);
systemConfigGridPanel.superclass.constructor.call(this, {
region:"center",
split:true,
title : '系统配置',
store : configStore,
loadMask : true,
margins : '-1',
viewConfig : {
forceFit : true,
columnsText : '列',
sortAscText : '升序',
sortDescText : '降序'
},
cm: cm,
listeners:{
'afteredit':function (e){
var r = e.record; //得到当前行所有数据
var f = e.field; //得到修改列
},
'beforeedit':function (e){
var isEditor=e.record.data.editorValue;
var r=e.row;
var f = e.field; //得到修改列
if (isEditor == 0){
e.cancel = true;
}
},
'cellclick':function (grid,row,num,e){
//grid.startEditing(row,num);
var record = grid.getStore().getAt(row); // Get the Record
var fieldName = grid.getColumnModel().getDataIndex(num); // Get field
var isEditor = record.get("editorValue");
// alert("num--"+num);
if (isEditor == 1){
grid.view.cm.setEditor(num,new Ext.form.Field({ //这样加进去之后报错,应怎么加。
allowBlank: false,
allowNegative: false
}))
}
}
}
})
}
})