/** * ERP项目gridpanel通用样式1 */ Ext.define('erp.view.fa.fix.CurrencysMonthGrid',{ extend: 'Ext.grid.Panel', alias: 'widget.currencysMonthGrid', region: 'south', layout : 'fit', id: 'grid', emptyText : $I18N.common.grid.emptyText, columnLines : true, autoScroll : true, store: [], columns: [], tbar:[{ xtype:'monthdatefield', id:'monthfield' },{ id:'searchCurrency', cls: 'x-btn-gray', iconCls: 'x-button-icon-query', width: 60, text:'查看' },{ xtype:'erpSaveButton' },{ xtype:'erpDeleteButton' },{ text: '取上期月末汇率', name: 'getlastend', cls: 'x-btn-gray', margin: '0 0 0 5' },{ text: '取月初汇率', name: 'getcrrate', cls: 'x-btn-gray', margin: '0 0 0 5' },{ xtype:'erpCloseButton' },{ xtype:'erpSyncButton' }], GridUtil: Ext.create('erp.util.GridUtil'), BaseUtil: Ext.create('erp.util.BaseUtil'), plugins: Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }), initComponent : function(){ var gridCondition = this.BaseUtil.getUrlParam('gridCondition'); gridCondition = (gridCondition == null || gridCondition == "null") ? "" : gridCondition; var conf = ' 1=1 '; if(Ext.String.trim(gridCondition)==''||Ext.String.trim(gridCondition)==null||Ext.String.trim(gridCondition)=='null'){ var searchfield = Number(Ext.Date.format(new Date(), 'Ym')); conf = conf+' and cm_yearmonth='+searchfield; }else{ conf = conf+gridCondition; } var gridParam = {caller: caller, condition: conf}; this.GridUtil.getGridColumnsAndStore(this, 'common/singleGridPanel.action', gridParam, ""); this.callParent(arguments); }, getGridStore: function(){ var grid = this; var jsonGridData = new Array(); var s = grid.getStore().data.items;//获取store里面的数据 for(var i=0;i