Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / examples / ux / grid / filter / BooleanFilter.js
similarity index 83%
rename from examples/ux/gridfilters/filter/BooleanFilter.js
rename to examples/ux/grid/filter/BooleanFilter.js
index d9fc1f9..4415bcb 100644 (file)
@@ -1,16 +1,10 @@
-/*!
- * Ext JS Library 3.3.1
- * Copyright(c) 2006-2010 Sencha Inc.
- * licensing@sencha.com
- * http://www.sencha.com/license
- */
-/** 
+/**
  * @class Ext.ux.grid.filter.BooleanFilter
  * @extends Ext.ux.grid.filter.Filter
  * Boolean filters use unique radio group IDs (so you can have more than one!)
  * <p><b><u>Example Usage:</u></b></p>
- * <pre><code>    
-var filters = new Ext.ux.grid.GridFilters({
+ * <pre><code>
+var filters = Ext.create('Ext.ux.grid.GridFilters', {
     ...
     filters: [{
         // required configs
@@ -25,7 +19,10 @@ var filters = new Ext.ux.grid.GridFilters({
 });
  * </code></pre>
  */
-Ext.ux.grid.filter.BooleanFilter = Ext.extend(Ext.ux.grid.filter.Filter, {
+Ext.define('Ext.ux.grid.filter.BooleanFilter', {
+    extend: 'Ext.ux.grid.filter.Filter',
+    alias: 'gridfilter.boolean',
+
        /**
         * @cfg {Boolean} defaultValue
         * Set this to null if you do not want either option to be checked by default. Defaults to false.
@@ -42,24 +39,24 @@ Ext.ux.grid.filter.BooleanFilter = Ext.extend(Ext.ux.grid.filter.Filter, {
         */
        noText : 'No',
 
-    /**  
+    /**
      * @private
      * Template method that is to initialize the filter and install required menu items.
      */
     init : function (config) {
         var gId = Ext.id();
                this.options = [
-                       new Ext.menu.CheckItem({text: this.yesText, group: gId, checked: this.defaultValue === true}),
-                       new Ext.menu.CheckItem({text: this.noText, group: gId, checked: this.defaultValue === false})];
-               
+                       Ext.create('Ext.menu.CheckItem', {text: this.yesText, group: gId, checked: this.defaultValue === true}),
+                       Ext.create('Ext.menu.CheckItem', {text: this.noText, group: gId, checked: this.defaultValue === false})];
+
                this.menu.add(this.options[0], this.options[1]);
-               
+
                for(var i=0; i<this.options.length; i++){
                        this.options[i].on('click', this.fireUpdate, this);
                        this.options[i].on('checkchange', this.fireUpdate, this);
                }
        },
-       
+
     /**
      * @private
      * Template method that is to get and return the value of the filter.
@@ -73,7 +70,7 @@ Ext.ux.grid.filter.BooleanFilter = Ext.extend(Ext.ux.grid.filter.Filter, {
      * @private
      * Template method that is to set the value of the filter.
      * @param {Object} value The value to set the filter
-     */        
+     */
        setValue : function (value) {
                this.options[value ? 0 : 1].setChecked(true);
        },
@@ -89,7 +86,7 @@ Ext.ux.grid.filter.BooleanFilter = Ext.extend(Ext.ux.grid.filter.Filter, {
                var args = {type: 'boolean', value: this.getValue()};
                return args;
        },
-       
+
     /**
      * Template method that is to validate the provided Ext.data.Record
      * against the filters configuration.
@@ -100,4 +97,4 @@ Ext.ux.grid.filter.BooleanFilter = Ext.extend(Ext.ux.grid.filter.Filter, {
     validateRecord : function (record) {
                return record.get(this.dataIndex) == this.getValue();
        }
-});
\ No newline at end of file
+});