Ext.QuickTips.init(); Ext.define('erp.controller.common.ProductRelative', { extend: 'Ext.app.Controller', views:[ 'common.productRelative.ProductRelative','common.productRelative.Form', 'core.trigger.DbfindTrigger','core.form.FtField','core.form.FtFindField','core.form.ConDateField' ], init:function(){ var me = this; var cal; if(caller=='ProductRelative!Query'){ cal = 'Product'; } if(caller=='ProjectRelative!Query'){ cal = 'Project'; } this.control({ 'field[name=pr_code]': { afterrender: function(f){ var val = getUrlParam('pr_code'); if(!Ext.isEmpty(val)){ f.setValue(getUrlParam('pr_code')); if(f.xtype == 'dbfindtrigger') { f.autoDbfind('form', cal, f.name, f.name + " like '%" + val + "%'"); } } }, change: function(f){ if(f.value != null && f.value != ''){ var html='' Ext.getCmp('ProductWh').update(html); } } }, 'field[name=prj_code]': { afterrender: function(f){ var val = getUrlParam('prj_code'); if(!Ext.isEmpty(val)){ f.setValue(getUrlParam('prj_code')); if(f.xtype == 'dbfindtrigger') { f.autoDbfind('form', cal, f.name, f.name + " like '%" + val + "%'"); } } }, change: function(f){ if(f.value != null && f.value != ''){ var html='' Ext.getCmp('ProductWh').update(html); } } } }) } });