/*ext模板 ==============================================*/ var grid=""; var dataModel=""; var ds=""; Ext.onReady(function(){ //ext准备方法开始 Ext.QuickTips.init(); //定义读取数据的模版 dataModel = Ext.data.Record.create([ { name:'id',mapping:'id'}, { name:'name',mapping:'name'}, { name:'funcPermission',mapping:'funcPermission'}, { name:'checkFlag',mapping:'checkFlag'} ]); //定义列模板 var sm = new Ext.grid.CheckboxSelectionModel(); var colModel = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer({width:30}), sm, { id:'id', header:"模块id", hidden:true, dataIndex:'id', width:50}, { id:'name', header:"模块名", dataIndex:'name', width:210}, { id:'funcPermission', header:"功能权限", dataIndex:'funcPermission', hidden:false, width:78, fixed:true, align:'left' , editor: new Ext.form.ComboBox({ store:Ideal.ComboBoxR.getStore(parent.dicContainer[184].childrenJson), displayField:'name', typeAhead: false, valueField:'value', forceSelection:true, hiddenName :'ILocked', lazyRender :true, readOnly : true, mode: 'local', triggerAction: 'all', listClass: 'x-combo-list-small' }), renderer:Ideal.ComboBoxR.getRenderer}, { id:'checkFlag', header:"选择标志", dataIndex:'checkFlag', hidden:true} ]); //定义存储器,从后台读取json数据 ds = new Ext.data.Store({ proxy: new Ext.data.HttpProxy({url: prjContextPath+'/moduleAction!queryModuleListByRoleId.action'}), reader: new Ext.data.JsonReader({root: 'data'},dataModel) }); //定义列表对象 grid = new Ext.grid.EditorGridPanel({ ds: ds, clicksToEdit:1, cm: colModel, selModel: sm, frame:false, border:false, width:400, height:260 }); /*默认选中发送对象*/ grid.store.on("load",function(){ var total = grid.getStore().getCount();//数据行数 var arr = new Array(); for(var i=0;i