" ? values.operatorLabel : values.operatorLabel.escHtml()]}
"; else{ this.editor.field.labelStyle="white-space: pre;"; this.editor.field.fieldLabel=" "; } } else { this.editor.field.fieldLabel=""; } }, getEditor: function(){ return(this.editor); } }; Ext.namespace('Ext.ux.netbox'); Ext.ux.netbox.FilterEditor = function(field,config){ Ext.ux.netbox.FilterEditor.superclass.constructor.call(this,field,config); }; Ext.extend(Ext.ux.netbox.FilterEditor,Ext.grid.GridEditor, { startEdit : function(el, value){ if(this.editing){ this.completeEdit(); } this.boundEl = Ext.get(el); var v = value !== undefined ? value : this.boundEl.dom.innerHTML; if(!this.rendered){ this.render(this.parentEl || document.body); } if(this.fireEvent("beforestartedit", this, this.boundEl, v) === false){ return; } this.startValue = v; this.setValue(v); if(this.autoSize){ var sz = this.boundEl.getSize(); switch(this.autoSize){ case "width": this.setSize(sz.width, ""); break; case "height": this.setSize("", sz.height); break; default: this.setSize(sz.width, sz.height); } } this.el.alignTo(this.boundEl, this.alignment); this.editing = true; this.show(); }, completeEdit : function(remainVisible){ if(!this.editing){ return; } var v = this.getValue(); if(this.revertInvalid !== false && !this.field.isValid()){ v = this.startValue; this.cancelEdit(true); } if(Ext.util.JSON.encode(v) === Ext.util.JSON.encode(this.startValue) && this.ignoreNoChange){ this.editing = false; this.hide(); return; } if(this.fireEvent("beforecomplete", this, v, this.startValue) !== false){ this.editing = false; if(this.updateEl && this.boundEl){ this.boundEl.update(v); } if(remainVisible !== true){ this.hide(); } this.fireEvent("complete", this, v, this.startValue); } } }); Ext.namespace('Ext.ux.netbox.core'); Ext.ux.netbox.core.AvailableValuesEditor=function(store,config){ if(config==undefined){ config={}; } var mode='local'; if(config.remote==true) mode='remote'; if(config.multiSelect==undefined){ config.multiSelect=false; } this.fieldCombo=new Ext.ux.Andrie.Select({ store : store, displayField : 'label', valueField : 'value', selectOnFocus : true, mode : mode, triggerAction : 'all', selectOnFocus : true, typeAhead : true, multiSelect : config.multiSelect, minChars : 0 }); if(!config.multiSelect){ this.fieldCombo.on('select',this.completeEditLater,this); } if(config.forceReload){ this.fieldCombo.on("beforequery",function(qe){ qe.combo.lastQuery = null; }); } if(config.caseSensitive) this.caseSensitive=true; else this.caseSensitive=false; Ext.ux.netbox.core.AvailableValuesEditor.superclass.constructor.call(this,this.fieldCombo,config); this.store=store; } Ext.extend(Ext.ux.netbox.core.AvailableValuesEditor,Ext.ux.netbox.FilterEditor,{ setValue: function(value){ var val=[]; var rawVal=[]; var label=''; if(value!=undefined && value!=null && Ext.type(value)=="array"){ if(value.length>0){ for(var i=0; i< value.length && ((this.fieldCombo.multiSelect) || i<1); i++){ val.push(value[i].value); if(value[i].label!=undefined){ rawVal.push(value[i].label); } else { rawVal.push(value[i].value); } } } } this.originalValue=value; Ext.ux.netbox.core.AvailableValuesEditor.superclass.setValue.call(this,val); Ext.form.ComboBox.superclass.setValue.call(this.fieldCombo,rawVal.join(",")); this.fieldCombo.value=val; this.fieldCombo.rawValueArray=rawVal; }, completeEditLater: function(){ var task=new Ext.util.DelayedTask(this.completeEdit,this); task.delay(0); }, getValue: function() { var val=Ext.ux.netbox.core.AvailableValuesEditor.superclass.getValue.call(this); if(Ext.type(val)=='string'){ val=val.split(','); } var toReturn=[]; for(var i=0; i