X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/ee06f37b0f6f6d94cd05a6ffae556660f7c4a2bc..c930e9176a5a85509c5b0230e2bff5c22a591432:/examples/grid-filtering/menu/RangeMenu.js diff --git a/examples/grid-filtering/menu/RangeMenu.js b/examples/grid-filtering/menu/RangeMenu.js deleted file mode 100644 index 388e5c5d..00000000 --- a/examples/grid-filtering/menu/RangeMenu.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Ext JS Library 2.2.1 - * Copyright(c) 2006-2009, Ext JS, LLC. - * licensing@extjs.com - * - * http://extjs.com/license - */ - -Ext.menu.RangeMenu = function(config){ - Ext.menu.RangeMenu.superclass.constructor.call(this, config); - - this.updateTask = new Ext.util.DelayedTask(this.fireUpdate, this); - - var cfg = this.fieldCfg; - var cls = this.fieldCls; - var fields = this.fields = Ext.applyIf(this.fields || {}, { - 'gt': new Ext.menu.EditableItem({ - icon: this.icons.gt, - editor: new cls(typeof cfg == "object" ? cfg.gt || '' : cfg) - }), - 'lt': new Ext.menu.EditableItem({ - icon: this.icons.lt, - editor: new cls(typeof cfg == "object" ? cfg.lt || '' : cfg) - }), - 'eq': new Ext.menu.EditableItem({ - icon: this.icons.eq, - editor: new cls(typeof cfg == "object" ? cfg.gt || '' : cfg) - }) - }); - this.add(fields.gt, fields.lt, '-', fields.eq); - - for(var key in fields) { - fields[key].on('keyup', this.onKeyUp.createDelegate(this, [fields[key]], true), this); - } - - this.addEvents('update'); -}; - -Ext.extend(Ext.menu.RangeMenu, Ext.menu.Menu, { - fieldCls: Ext.form.NumberField, - fieldCfg: '', - updateBuffer: 500, - icons: { - gt: '/img/small_icons/greater_then.png', - lt: '/img/small_icons/less_then.png', - eq: '/img/small_icons/equals.png' - }, - - fireUpdate: function() { - this.fireEvent("update", this); - }, - - setValue: function(data) { - for(var key in this.fields) { - this.fields[key].setValue(data[key] !== undefined ? data[key] : ''); - } - this.fireEvent("update", this); - }, - - getValue: function() { - var result = {}; - for(var key in this.fields) { - var field = this.fields[key]; - if(field.isValid() && String(field.getValue()).length > 0) { - result[key] = field.getValue(); - } - } - - return result; - }, - - onKeyUp: function(event, input, notSure, field) { - if(event.getKey() == event.ENTER && field.isValid()) { - this.hide(true); - return; - } - - if(field == this.fields.eq) { - this.fields.gt.setValue(null); - this.fields.lt.setValue(null); - } else { - this.fields.eq.setValue(null); - } - - this.updateTask.delay(this.updateBuffer); - } -}); \ No newline at end of file