Ext.define('erp.view.ma.userGroup.userGroupGrid',{ extend: 'Ext.grid.Panel', alias: 'widget.erpUserGroupGrid', requires: ['erp.view.core.toolbar.Toolbar', 'erp.view.core.plugin.CopyPasteMenu'], region: 'south', layout : 'fit', id: 'grid', emptyText : $I18N.common.grid.emptyText, columnLines : true, autoScroll : true, store: [], columns: [], binds:null, bodyStyle: 'background-color:#f1f1f1;', plugins: [Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1, listeners:{ beforeedit:function(e){ var g=e.grid,r=e.record,f=e.field; if(g.binds){ var bool=true; Ext.Array.each(g.binds,function(item){ if(Ext.Array.contains(item.fields,f)){ Ext.each(item.refFields,function(field){ if(r.get(field)!=null && r.get(field)!=0 && r.get(field)!='' && r.get(field)!='0'){ bool=false; } }); } }); return bool; } } } }), Ext.create('erp.view.core.plugin.CopyPasteMenu')], GridUtil: Ext.create('erp.util.GridUtil'), BaseUtil: Ext.create('erp.util.BaseUtil'), necessaryField: '',//必填字段 detno: '',//编号字段 keyField: '',//主键字段 mainField: '',//对应主表主键的字段 initComponent : function(){ this.callParent(arguments); }, listeners:{ afterrender:function(f){ f.GridUtil.add10EmptyItems(f); }, scrollershow: function(scroller) { if (scroller && scroller.scrollEl) { scroller.clearManagedListeners(); scroller.mon(scroller.scrollEl, 'scroll', scroller.onElScroll, scroller); } } }, store: new Ext.data.Store({ fields: ['ugp_id', 'sn_caller', 'sn_id', 'sn_module', 'sn_displayname','ugp_ifread','ugp_ifwrite','ugp_ifdelete','ugp_ifspecial','ugp_ifall'] }), necessaryFields:'sn_module', columns: [{ xtype: 'rownumberer', width: 35, cls: 'x-grid-header-1', align: 'center' },{ style :"text-align:center", text: 'ID', width: 160, hidden:true, dataIndex: 'ugp_id', },{ style :"text-align:center", text: 'caller', width: 160, hidden:true, dataIndex: 'sn_caller', },{ style :"text-align:center", text: 'sn_id', width: 160, hidden:true, dataIndex: 'sn_id', },{ style :"text-align:center", text: '所属模块', width: 160, dataIndex: 'sn_module', readOnly:true, ignore: true, },{ style :"text-align:center", text: '功能模块', width: 120, dataIndex: 'sn_displayname', ignore: true, logic:'ignore' },{ style :"text-align:center", text: '读权限', width: 120, dataIndex: 'ugp_ifread', xtype:'checkcolumn', },{ style :"text-align:center", text: '写权限', width: 120, dataIndex: 'ugp_ifwrite', xtype:'checkcolumn' },{ style :"text-align:center", text: '删权限', width: 120, dataIndex: 'ugp_ifdelete', xtype:'checkcolumn' },{ style :"text-align:center", text: '特殊权限', width: 120, dataIndex: 'ugp_ifspecial', xtype:'checkcolumn' },{ style :"text-align:center", text: '全部权限', width: 120, dataIndex: 'ugp_ifall', xtype:'checkcolumn' }], setReadOnly: function(bool){ this.readOnly = bool; } });