FamilyGrid.js 918 B

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