Gef.ns('Gef.org'); Gef.org.DbfindField = Ext.extend(Ext.form.TriggerField, { triggerClass : "x-form-search-trigger", initComponent: function() { this.readOnly = false; Gef.org.OrgField.superclass.initComponent.call(this); this.addEvents('select'); }, onTriggerClick: function() { this.showWindow(); }, showWindow: function(store) { var trigger = this, bool = true;// 放大镜所在 bool = trigger.fireEvent('beforetrigger', trigger); if(bool == false) { return; } var key = this.name,// name属性 dbfind = '',// 需要dbfind的表和字段 dbBaseCondition='', dbCondition='', dbGridCondition='', findConfig=this.findConfig, dbKey=this.dbKey, mappingKey=this.mappingKey, gridKey=this.gridKey, mappinggirdKey=this.mappinggirdKey; window.onTriggerClick = this.id; // 存在查询条件的字段 if(findConfig){ dbCondition = findConfig; } if(dbKey){ var dbKeyValue = Ext.getCmp(dbKey).value; if(dbKeyValue){ dbCondition = mappingKey + " IS '" + dbKeyValue + "'"; } else { showError(this.dbMessage); return } } if(gridKey){ var gridKeys = gridKey.split('|'); var mappinggirdKeys = mappinggirdKey.split('|'); var gridErrorMessages = this.gridErrorMessage.split('|'); for(var i=0;i' }], buttons : [{ text : '关 闭', iconCls: 'x-button-icon-close', cls: 'x-btn-gray', handler : function(){ Ext.getCmp('dbwin').close(); } },{ text: '重置条件', id: 'reset', cls: 'x-btn-gray', hidden: true, handler: function(){ var grid = Ext.getCmp('dbwin').el.dom.getElementsByTagName('iframe')[0].contentWindow.document.defaultView.Ext.getCmp('dbfindGridPanel'); grid.resetCondition(); grid.getCount(); } }] }); dbwin.show(); trigger.lastTriggerId = null; Gef.activeEditor.disable(); }, hideWindow: function() { this.getWindow().hide(); Gef.activeEditor.enable(); }, getWindow: function(store) { if (!this.orgWindow) { this.orgWindow = this.createWindow(store); } return this.orgWindow; } }); Ext.reg('dbfindfield', Gef.org.DbfindField);