JProcessBaseSet.js 989 B

1234567891011121314151617181920212223242526272829303132333435
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.common.JProcessBaseSet', {
  3. extend: 'Ext.app.Controller',
  4. FormUtil: Ext.create('erp.util.FormUtil'),
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. views:[
  7. 'core.form.Panel','common.JProcess.JProcessBaseSet',
  8. 'core.button.Save','core.button.Close','core.button.Update','core.button.Delete',
  9. 'core.trigger.DbfindTrigger'
  10. ],
  11. init:function(){
  12. var me = this;
  13. this.control({
  14. 'erpDeleteButton' : {
  15. click: function(btn){
  16. me.FormUtil.onDelete(Ext.getCmp('ps_id').value);
  17. }
  18. },
  19. 'erpUpdateButton': {
  20. click: function(btn){
  21. me.beforeUpdate();
  22. }
  23. },
  24. 'erpCloseButton': {
  25. click: function(btn){
  26. me.FormUtil.beforeClose(me);
  27. }
  28. }
  29. });},
  30. beforeUpdate: function(){
  31. if(Ext.getCmp('ps_id').value)this.FormUtil.onUpdate(this);
  32. else this.FormUtil.beforeSave(this);
  33. }
  34. });