Ext.define('erp.view.hr.emplmana.SourceGroup',{ extend: 'Ext.Viewport', layout: 'fit', hideBorders: true, initComponent : function(){ var me = this; Ext.apply(me, { items: [{ layout: 'anchor', items: [{ xtype: 'erpFormPanel', anchor: '100% 30%', deleteUrl: 'hr/employee/deleteSourceGroupAllDetail.action', updateUrl: 'hr/employee/updateSourceGroupDetail.action', getIdUrl: 'common/getId.action?seq=CS$USERRESOURCE_SEQ', },{ xtype: 'erpGridPanel2', anchor: '100% 70%', /* xtype: 'gridpanel', id: 'grid', anchor : '100% 70%', requires: ['erp.view.core.plugin.CopyPasteMenu'], columns: [{ style :"text-align:center", text:'资源编号', logic:"necessaryField", width: 160, dataIndex: 'sc_code', editor: { xtype: 'dbfindtrigger' }, dbfind: 'Source|sc_code', allowBlank:false, },{ style :"text-align:center", text: 'ID', width: 0, hidden : true, dataIndex: 'sc_id', },{ style :"text-align:center", text: '资源名称', width: 120, dataIndex: 'sc_name', },{ style :"text-align:center", xtype: 'actioncolumn', header: '操作', width: 100, align: 'center', items: [{ icon: basePath + 'resource/images/16/delete.png', tooltip: '删除', handler: function(view, rowIndex, colIndex) { var rec = view.getStore().getAt(rowIndex); view.ownerCt.deleteRecord(rec); } }] }], necessaryField: 'sc_code', GridUtil: Ext.create('erp.util.GridUtil'), dbfinds: [{ field: 'sc_code', dbGridField: 'sc_code' },{ field: 'sc_name', dbGridField: 'sc_name' },{ field: 'sc_id', dbGridField: 'sc_id' }], columnLines: true, plugins: [Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }),Ext.create('erp.view.core.plugin.CopyPasteMenu')], store: new Ext.data.Store({ fields: ['sc_id', 'sc_code', 'sc_name'], data: [{},{},{},{}] }), deleteRecord: function(record) { if(record.get('sc_id') && record.get('sc_id') >= 0) { var grid = this, url = "hr/employee/deleteSourceGroup.action"; var form = Ext.getCmp('form'); grid.setLoading(true); Ext.Ajax.request({ url : basePath + url, params: { caller: caller, id: record.get('sc_id'), key: Ext.getCmp(form.keyField).value }, method : 'post', callback : function(opt, success, response){ grid.setLoading(false); success && grid.store.remove(record); } }); } else { this.store.remove(record); } } */}] }] }); me.callParent(arguments); } });