RelativeSearchGrid.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Ext.define('erp.view.ma.RelativeSearchGrid',{
  2. extend: 'Ext.grid.Panel',
  3. alias: 'widget.relativesearchgrid',
  4. layout : 'fit',
  5. id: 'relativesearchgrid',
  6. emptyText : $I18N.common.grid.emptyText,
  7. columnLines : true,
  8. autoScroll : true,
  9. detno: 'rsg_detno',
  10. keyField: 'rsg_id',
  11. mainField: 'rsg_rsid',
  12. columns: [],
  13. bodyStyle:'background-color:#f1f1f1;',
  14. plugins: Ext.create('Ext.grid.plugin.CellEditing', {
  15. clicksToEdit: 1
  16. }),
  17. bbar: {xtype: 'erpToolbar'},
  18. caller:'RelativeSearchGrid',
  19. GridUtil: Ext.create('erp.util.GridUtil'),
  20. BaseUtil: Ext.create('erp.util.BaseUtil'),
  21. initComponent : function(){
  22. this.callParent(arguments);
  23. this.getMyData();
  24. },
  25. getMyData: function(id){
  26. if(!id){
  27. id = 0;
  28. }
  29. var me = this,
  30. condition=getUrlParam('formCondition');
  31. if(condition!='' && condition!=null) id=condition.split('IS')[1];
  32. var params = {
  33. caller: "RelativeSearchGrid",
  34. condition: "rsg_rsid=" + id
  35. };
  36. this.gridCondition="rsg_rsid=" + id;
  37. if(me.columns && me.columns.length > 2){
  38. me.GridUtil.loadNewStore(me, params);
  39. } else {
  40. me.GridUtil.getGridColumnsAndStore(me, 'common/singleGridPanel.action', params);
  41. }
  42. }
  43. });