Ext.define('uas.view.form.formpanel.Grid', { extend: 'Ext.grid.Panel', xtype: 'formpanel-grid', requires: [ 'Ext.selection.CellModel', 'Ext.grid.feature.Summary' ], emptyText: '无数据', loadMask: true, bind:'{formGridStore}', features: [{ ftype: 'summary', dock: 'bottom' }], selModel: { type: 'cellmodel' }, plugins: { cellediting: { clicksToEdit: 1 } }, initComponent: function () { var me = this; Ext.apply(me, { store: Ext.create('uas.store.FormGridStore',{ grid: me, autoLoad: true, autoDestroy: true }) }); me.callParent(arguments); }, dockedItems: [{ cls:'x-grid-operateToolbar', xtype: 'toolbar', dock: 'top', height:32, defaults:{ cls:'x-btn-blue', xtype:'button', margin:'0 0 0 6', }, items:[{ text:'新增' },{ text:'处理' },{ text:'删除' },{ text:'复制行' },{ text:'粘贴行' }] }], columns: [{ dataIndex: 'id', text: '序号', width:110, align:'center', locked: true, summaryType: 'count', summaryRenderer: function(value, summaryData, dataIndex) { return Ext.String.format('共{0}条', value); } }, { dataIndex: 'code', text: '采购单号(单选)', width:200, locked: true, filter: { type:'string' }, editor: { name:'code', xtype:'producttrigger', allowBlank: false, selectOnFocus: false } },{ dataIndex: 'vcode', text: '供应商编号(多选)', width:200, locked: true, filter: { type:'string' }, editor: { name:'vcode', xtype:'vendormultitrigger', allowBlank: false, selectOnFocus: false } }, { dataIndex: 'status', text: '单据状态', width:100, filter: { type:'string' } }, { xtype: 'datecolumn', dataIndex: 'date', text: '下单日期', width: 200, filter: { type:'date' } }, { dataIndex: 'vendor', text: '供应商名', width: 220, filter: { type:'string' } }, { xtype:'numbercolumn', dataIndex: 'price', text: '含税金额', format:'0,000.00', width:190, filter: { type:'number' }, summaryType: 'sum', summaryRenderer: function(value, summaryData, dataIndex) { return Ext.String.format('合计:{0} 元', value.toFixed(2)); } },{ dataIndex: 'special', text:'特殊采购', width:120, filter: { type:'combo', combo:[ ["true", "是"], ["false", "否"] ] } },{ dataIndex: 'currency', text: '币别', width:70 },{ dataIndex: 'recordman', text: '采购员', width:70 },{ dataIndex: 'auditman', text: '审核人', width:70 }] });