--- /dev/null
+Ext.ux.grid.filter.BooleanFilter = Ext.extend(Ext.ux.grid.filter.Filter, {\r
+ defaultValue: false,\r
+ yesText: "Yes",\r
+ noText: "No",\r
+\r
+ init: function(){\r
+ var gId = Ext.id();\r
+ this.options = [\r
+ new Ext.menu.CheckItem({text: this.yesText, group: gId, checked: this.defaultValue === true}),\r
+ new Ext.menu.CheckItem({text: this.noText, group: gId, checked: this.defaultValue === false})];\r
+ \r
+ this.menu.add(this.options[0], this.options[1]);\r
+ \r
+ for(var i=0; i<this.options.length; i++){\r
+ this.options[i].on('click', this.fireUpdate, this);\r
+ this.options[i].on('checkchange', this.fireUpdate, this);\r
+ }\r
+ },\r
+ \r
+ isActivatable: function(){\r
+ return true;\r
+ },\r
+ \r
+ fireUpdate: function(){ \r
+ this.fireEvent("update", this); \r
+ this.setActive(true);\r
+ },\r
+ \r
+ setValue: function(value){\r
+ this.options[value ? 0 : 1].setChecked(true);\r
+ },\r
+ \r
+ getValue: function(){\r
+ return this.options[0].checked;\r
+ },\r
+ \r
+ serialize: function(){\r
+ var args = {type: 'boolean', value: this.getValue()};\r
+ this.fireEvent('serialize', args, this);\r
+ return args;\r
+ },\r
+ \r
+ validateRecord: function(record){\r
+ return record.get(this.dataIndex) == this.getValue();\r
+ }\r
+});
\ No newline at end of file