Panel5.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * ERP项目gridpanel通用样式5
  3. */
  4. Ext.define('erp.view.core.grid.Panel5',{
  5. extend: 'Ext.grid.Panel',
  6. alias: 'widget.erpGridPanel5',
  7. layout : 'fit',
  8. id: 'grid',
  9. emptyText : $I18N.common.grid.emptyText,
  10. columnLines : true,
  11. autoScroll : true,
  12. condition:null,
  13. store: [],
  14. columns: [],
  15. GridUtil: Ext.create('erp.util.GridUtil'),
  16. BaseUtil: Ext.create('erp.util.BaseUtil'),
  17. plugins:[ Ext.create('Ext.grid.plugin.CellEditing', {
  18. clicksToEdit: 1
  19. }), Ext.create('erp.view.core.plugin.CopyPasteMenu')],
  20. caller: null,
  21. initComponent : function(){
  22. var me = this, condition = me.condition || '';
  23. if(typeof me.getCondition === 'function'){
  24. condition = me.getCondition.call(null, me);
  25. me.condition=me.condition||condition;
  26. }
  27. var gridParam = {caller: this.caller || caller, condition: condition};
  28. var _copyConf=getUrlParam('_copyConf');
  29. if(_copyConf!=null){//复制来源单据的条件
  30. gridParam._copyConf=_copyConf;
  31. }
  32. this.GridUtil.getGridColumnsAndStore(this, 'common/singleGridPanel.action', gridParam, "");//从后台拿到gridpanel的配置及数据
  33. this.callParent(arguments);
  34. if(!this.boxready) {
  35. if(this.allowExtraButtons)// 加载其它按钮
  36. this.on('reconfigure', this.loadExtraButton, this, {single: true, delay: 1000});
  37. this.on('summary', this.generateSummaryData, this, {single: true, delay: 1000});
  38. }
  39. }
  40. });