RelationGrid.js 1007 B

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