2 * Ext JS Library 2.2.1
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
9 Ext.grid.filter.NumericFilter = Ext.extend(Ext.grid.filter.Filter, {
\r
11 this.menu = new Ext.menu.RangeMenu();
\r
13 this.menu.on("update", this.fireUpdate, this);
\r
16 fireUpdate: function() {
\r
17 this.setActive(this.isActivatable());
\r
18 this.fireEvent("update", this);
\r
21 isActivatable: function() {
\r
22 var value = this.menu.getValue();
\r
23 return value.eq !== undefined || value.gt !== undefined || value.lt !== undefined;
\r
26 setValue: function(value) {
\r
27 this.menu.setValue(value);
\r
30 getValue: function() {
\r
31 return this.menu.getValue();
\r
34 serialize: function() {
\r
36 var values = this.menu.getValue();
\r
37 for(var key in values) {
\r
38 args.push({type: 'numeric', comparison: key, value: values[key]});
\r
40 this.fireEvent('serialize', args, this);
\r
44 validateRecord: function(record) {
\r
45 var val = record.get(this.dataIndex),
\r
46 values = this.menu.getValue();
\r
48 if(values.eq != undefined && val != values.eq) {
\r
51 if(values.lt != undefined && val >= values.lt) {
\r
54 if(values.gt != undefined && val <= values.gt) {
\r