Ext.define('saas.view.test.order.FormController', { extend: 'saas.view.core.form.FormPanelController', alias: 'controller.test-order-formcontroller', init: function (form) { var me = this; this.control({ /**放大镜新增demo*/ "field[name=combo]":{ beforerender:function(f){ f.addHandler=me.addCombo; } }, //放大镜赋值关系 以及 tpl模板 'dbfindtrigger[name=puVendcode]':{ beforerender:function(f){ Ext.apply(f,{ conditionCode:'ve_code', dataUrl:'http://192.168.253.41:8800/purchase/component/dbfind/vendor', dbfinds:[{ from:'vendCode',to:'puVendcode' },{ from:'vendName',to:'puVendname' }], dbtpls:[{ field:'vendCode',width:100 },{ field:'vendName',width:100 }], dbColumns:[{ "text": "供应商ID", "flex": 0, "dataIndex": "vendId", "width": 0, "xtype": "", "items": null },{ "text": "供应商编号", "flex": 1, "dataIndex": "vendCode", "width": 100, "xtype": "", "items": null }, { "text": "供应商名称", "flex": 1, "dataIndex": "vendName", "xtype": "", "items": null }, { "text": "供应商类型", "flex": 0, "dataIndex": "vendType", "width": 200, "xtype": "", "items": null }] }) ; } }, //放大镜赋值关系 以及 tpl模板 'dbfindtrigger[name=pdProdcode]':{ beforerender:function(f){ Ext.apply(f,{ conditionCode:'pr_code', dataUrl:'http://192.168.253.41:8800/purchase/component/dbfind/product', dbfinds:[{ from:'pr_code',to:'pdVendcode' }], dbtpls:[{ field:'pr_code',width:100 },{ field:'pr_detail',width:100 }], dbColumns:[{ "text": "物料ID", "flex": 0, "dataIndex": "pr_id", "width": 0, "xtype": "", "items": null },{ "text": "物料编号", "flex": 1, "dataIndex": "pr_code", "width": 100, "xtype": "", "items": null }, { "text": "物料名称", "flex": 1, "dataIndex": "pr_detail", "xtype": "", "items": null }, { "text": "物料规格", "flex": 0, "dataIndex": "pr_spec", "width": 200, "xtype": "", "items": null }] }) ; } } }); }, addCombo:function(){ var combo=this.ownerCmp; Ext.create('Ext.window.Window',{ layout:'vbox', bodyPadding: 15, width:500, items:[{ fieldLabel:'实际值', xtype:'textfield' },{ fieldLabel:'显示值', xtype:'textfield' }], buttons:[{ text:'确认', handler:function(b){ combo.setValue('ok'); b.up('window').close(); } }], renderTo:this.ownerCmp.ownerCt.getEl() }).show(); } });