FormController.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. Ext.define('saas.view.test.order.FormController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.test-order-formcontroller',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. /**放大镜新增demo*/
  8. "field[name=combo]":{
  9. beforerender:function(f){
  10. f.addHandler=me.addCombo;
  11. }
  12. },
  13. //放大镜赋值关系 以及 tpl模板
  14. 'dbfindtrigger[name=pu_vendorcode]':{
  15. beforerender:function(f){
  16. Ext.apply(f,{
  17. dbfinds:[{
  18. from:'pu_vendorcode',to:'pu_vendorcode'
  19. },{
  20. from:'pu_vendorname',to:'pu_vendorname'
  21. }],
  22. dbtpls:[{
  23. field:'pu_vendorcode',width:100
  24. },{
  25. field:'pu_vendorname',width:100
  26. }]
  27. }) ;
  28. }
  29. }
  30. });
  31. },
  32. addCombo:function(){
  33. var combo=this.ownerCmp;
  34. Ext.create('Ext.window.Window',{
  35. layout:'vbox',
  36. bodyPadding: 15,
  37. width:500,
  38. items:[{
  39. fieldLabel:'实际值',
  40. xtype:'textfield'
  41. },{
  42. fieldLabel:'显示值',
  43. xtype:'textfield'
  44. }],
  45. buttons:[{
  46. text:'确认',
  47. handler:function(b){
  48. combo.setValue('ok');
  49. b.up('window').close();
  50. }
  51. }],
  52. renderTo:this.ownerCmp.ownerCt.getEl()
  53. }).show();
  54. }
  55. });