1 <div class="body-wrap" xmlns:ext="http://www.extjs.com"><div class="top-tools"><a class="inner-link" href="#Ext.ux.grid.GridFilters-props"><img src="resources/images/default/s.gif" class="item-icon icon-prop">Properties</a> <a class="inner-link" href="#Ext.ux.grid.GridFilters-methods"><img src="resources/images/default/s.gif" class="item-icon icon-method">Methods</a> <a class="inner-link" href="#Ext.ux.grid.GridFilters-events"><img src="resources/images/default/s.gif" class="item-icon icon-event">Events</a> <a class="inner-link" href="#Ext.ux.grid.GridFilters-configs"><img src="resources/images/default/s.gif" class="item-icon icon-config">Config Options</a> <a class="bookmark" href="../docs/?class=Ext.ux.grid.GridFilters"><img src="resources/images/default/s.gif" class="item-icon icon-fav">Direct Link</a> </div><div class="inheritance res-block"><pre class="res-block-inner"><a href="output/Ext.util.Observable.html" ext:member="" ext:cls="Ext.util.Observable">Observable</a> <img src="resources/elbow-end.gif">GridFilters</pre></div><h1>Class <a href="source/GridFilters.html#cls-Ext.ux.grid.GridFilters">Ext.ux.grid.GridFilters</a></h1><table cellspacing="0"><tr><td class="label">Package:</td><td class="hd-info">Ext.ux.grid</td></tr><tr><td class="label">Defined In:</td><td class="hd-info">GridFilters.js</td></tr><tr><td class="label">Class:</td><td class="hd-info"><a href="source/GridFilters.html#cls-Ext.ux.grid.GridFilters">GridFilters</a></td></tr><tr><td class="label">Extends:</td><td class="hd-info"><a href="output/Ext.util.Observable.html" ext:cls="Ext.util.Observable" ext:member="">Observable</a></td></tr><tr><td class="hd-info"></td></tr></table><div class="description"><p>GridFilter is a plugin (<code>ptype=<em>'gridfilters'</em></code>) for grids that
\r
2 allow for a slightly more robust representation of filtering than what is
\r
3 provided by the default store.</p>
\r
4 <p>Filtering is adjusted by the user using the grid's column header menu
\r
5 (this menu can be disabled through configuration). Through this menu users
\r
6 can configure, enable, and disable filters for each column.</p>
\r
7 <p><b><u>Features:</u></b></p>
\r
8 <div class="mdetail-params"><ul>
\r
9 <li><b>Filtering implementations</b> :
\r
10 <div class="sub-desc">
\r
11 Default filtering for Strings, Numeric Ranges, Date Ranges, Lists (which can
\r
12 be backed by a Ext.data.Store), and Boolean. Additional custom filter types
\r
13 and menus are easily created by extending Ext.ux.grid.filter.Filter.
\r
15 <li><b>Graphical indicators</b> :
\r
16 <div class="sub-desc">
\r
17 Columns that are filtered have <a href="output/Ext.ux.grid.GridFilters.html#Ext.ux.grid.GridFilters-filterCls" ext:member="filterCls" ext:cls="Ext.ux.grid.GridFilters">a configurable css class</a>
\r
18 applied to the column headers.
\r
21 <div class="sub-desc">
\r
22 If specified as a plugin to the grid's configured PagingToolbar, the current page
\r
23 will be reset to page 1 whenever you update the filters.
\r
25 <li><b>Automatic Reconfiguration</b> :
\r
26 <div class="sub-desc">
\r
27 Filters automatically reconfigure when the grid 'reconfigure' event fires.
\r
29 <li><b>Stateful</b> :
\r
30 Filter information will be persisted across page loads by specifying a
\r
31 <code>stateId</code> in the Grid configuration.
\r
32 <div class="sub-desc">
\r
33 The filter collection binds to the
\r
34 <code><a href="output/Ext.grid.GridPanel.html#Ext.grid.GridPanel-beforestaterestore" ext:member="beforestaterestore" ext:cls="Ext.grid.GridPanel">beforestaterestore</a></code>
\r
35 and <code><a href="output/Ext.grid.GridPanel.html#Ext.grid.GridPanel-beforestatesave" ext:member="beforestatesave" ext:cls="Ext.grid.GridPanel">beforestatesave</a></code>
\r
36 events in order to be stateful.
\r
38 <li><b>Grid Changes</b> :
\r
39 <div class="sub-desc"><ul>
\r
40 <li>A <code>filters</code> <i>property</i> is added to the grid pointing to
\r
42 <li>A <code>filterupdate</code> <i>event</i> is added to the grid and is
\r
43 fired upon onStateChange completion.</li>
\r
45 <li><b>Server side code examples</b> :
\r
46 <div class="sub-desc"><ul>
\r
47 <li><a href="http://www.vinylfox.com/extjs/grid-filter-php-backend-code.php">PHP</a> - (Thanks VinylFox)</li>
\r
48 <li><a href="http://extjs.com/forum/showthread.php?p=77326#post77326">Ruby on Rails</a> - (Thanks Zyclops)</li>
\r
49 <li><a href="http://extjs.com/forum/showthread.php?p=176596#post176596">Ruby on Rails</a> - (Thanks Rotomaul)</li>
\r
50 <li><a href="http://www.debatablybeta.com/posts/using-extjss-grid-filtering-with-django/">Python</a> - (Thanks Matt)</li>
\r
51 <li><a href="http://mcantrell.wordpress.com/2008/08/22/extjs-grids-and-grails/">Grails</a> - (Thanks Mike)</li>
\r
54 <p><b><u>Example usage:</u></b></p>
\r
55 <pre><code><b>var</b> store = <b>new</b> Ext.data.GroupingStore({
\r
59 <b>var</b> filters = <b>new</b> Ext.ux.grid.GridFilters({
\r
60 autoReload: false, <i>//don't reload automatically
\r</i>
61 local: true, <i>//only filter locally
\r</i>
62 <i>// filters may be configured through the plugin,
\r</i>
63 <i>// or <b>in</b> the column definition within the column model configuration
\r</i>
65 type: <em>'numeric'</em>,
\r
66 dataIndex: <em>'id'</em>
\r
68 type: <em>'string'</em>,
\r
69 dataIndex: <em>'name'</em>
\r
71 type: <em>'numeric'</em>,
\r
72 dataIndex: <em>'price'</em>
\r
74 type: <em>'date'</em>,
\r
75 dataIndex: <em>'dateAdded'</em>
\r
77 type: <em>'list'</em>,
\r
78 dataIndex: <em>'size'</em>,
\r
79 options: [<em>'extra small'</em>, <em>'small'</em>, <em>'medium'</em>, <em>'large'</em>, <em>'extra large'</em>],
\r
82 type: <em>'boolean'</em>,
\r
83 dataIndex: <em>'visible'</em>
\r
86 <b>var</b> cm = <b>new</b> Ext.grid.ColumnModel([{
\r
90 <b>var</b> grid = <b>new</b> Ext.grid.GridPanel({
\r
93 view: <b>new</b> Ext.grid.GroupingView(),
\r
97 bbar: <b>new</b> Ext.PagingToolbar({
\r
100 plugins: [filters] <i>//reset page to page 1 <b>if</b> filters change
\r</i>
104 store.load({params: {start: 0, limit: 15}});
\r
106 <i>// a filters property is added to the grid
\r</i>
107 grid.filters</code></pre></div><div class="hr"></div><a id="Ext.ux.grid.GridFilters-configs"></a><h2>Config Options</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Config Options</th><th class="msource-header">Defined By</th></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-autoReload"></a><b><a href="source/GridFilters.html#cfg-Ext.ux.grid.GridFilters-autoReload">autoReload</a></b> : Boolean<div class="mdesc"><div class="short">Defaults to true, reloading the datasource when a filter change happens.
\r
108 Set this to false to prevent the datastore ...</div><div class="long">Defaults to true, reloading the datasource when a filter change happens.
\r
109 Set this to false to prevent the datastore from being reloaded if there
\r
110 are changes to the filters. See <code><a href="output/updateBuffer.html" ext:cls="updateBuffer">updateBuffer</a></code>.</div></div></td><td class="msource">GridFilters</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-encode"></a><b><a href="source/GridFilters.html#cfg-Ext.ux.grid.GridFilters-encode">encode</a></b> : Boolean<div class="mdesc"><div class="short">Specify true for buildQuery to use Ext.util.JSON.encode to
\r
111 encode the filter query parameter sent with a remote requ...</div><div class="long">Specify true for <a href="output/Ext.ux.grid.GridFilters.html#Ext.ux.grid.GridFilters-buildQuery" ext:member="buildQuery" ext:cls="Ext.ux.grid.GridFilters">buildQuery</a> to use Ext.util.JSON.encode to
\r
112 encode the filter query parameter sent with a remote request.
\r
113 Defaults to false.</div></div></td><td class="msource">GridFilters</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-filterCls"></a><b><a href="source/GridFilters.html#cfg-Ext.ux.grid.GridFilters-filterCls">filterCls</a></b> : String<div class="mdesc">The css class to be applied to column headers with active filters.
\r
114 Defaults to <tt>'ux-filterd-column'</tt>.</div></td><td class="msource">GridFilters</td></tr><tr class="config-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-filters"></a><b><a href="source/GridFilters.html#cfg-Ext.ux.grid.GridFilters-filters">filters</a></b> : Array<div class="mdesc"><div class="short">An Array of filters config objects. Refer to each filter type class for
\r
115 configuration details specific to each filte...</div><div class="long">An Array of filters config objects. Refer to each filter type class for
\r
116 configuration details specific to each filter type. Filters for Strings,
\r
117 Numeric Ranges, Date Ranges, Lists, and Boolean are the standard filters
\r
118 available.</div></div></td><td class="msource">GridFilters</td></tr><tr class="config-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-listeners"></a><b><a href="source/Observable.html#cfg-Ext.util.Observable-listeners">listeners</a></b> : Object<div class="mdesc"><div class="short">A config object containing one or more event handlers to be added to this
\r
119 object during initialization. This should ...</div><div class="long"><p>A config object containing one or more event handlers to be added to this
120 object during initialization. This should be a valid listeners config object as specified in the
121 <a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a> example for attaching multiple handlers at once.</p>
122 <br><p><b><u>DOM events from ExtJs <a href="output/Ext.Component.html" ext:cls="Ext.Component">Components</a></u></b></p>
123 <br><p>While <i>some</i> ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this
124 is usually only done when extra value can be added. For example the <a href="output/Ext.DataView.html" ext:cls="Ext.DataView">DataView</a>'s
125 <b><code><a href="output/Ext.DataView.html#Ext.DataView-click" ext:member="click" ext:cls="Ext.DataView">click</a></code></b> event passing the node clicked on. To access DOM
126 events directly from a Component's HTMLElement, listeners must be added to the <i><a href="output/Ext.Component.html#Ext.Component-getEl" ext:member="getEl" ext:cls="Ext.Component">Element</a></i> after the Component
127 has been rendered. A plugin can simplify this step:<pre><code><i>// Plugin is configured <b>with</b> a listeners config object.</i>
128 <i>// The Component is appended to the argument list of all handler functions.</i>
129 Ext.DomObserver = Ext.extend(Object, {
130 constructor: <b>function</b>(config) {
131 this.listeners = config.listeners ? config.listeners : config;
134 <i>// Component passes itself into plugin's init method</i>
135 init: <b>function</b>(c) {
136 <b>var</b> p, l = this.listeners;
137 <b>for</b> (p <b>in</b> l) {
138 <b>if</b> (Ext.isFunction(l[p])) {
139 l[p] = this.createHandler(l[p], c);
141 l[p].fn = this.createHandler(l[p].fn, c);
145 <i>// Add the listeners to the Element immediately following the render call</i>
146 c.render = c.render.<a href="output/Function.html#Function-createSequence" ext:member="createSequence" ext:cls="Function">createSequence</a>(<b>function</b>() {
147 <b>var</b> e = c.getEl();
154 createHandler: <b>function</b>(fn, c) {
155 <b>return</b> <b>function</b>(e) {
161 <b>var</b> combo = <b>new</b> Ext.form.ComboBox({
163 <i>// Collapse combo when its element is clicked on</i>
164 plugins: [ <b>new</b> Ext.DomObserver({
165 click: <b>function</b>(evt, comp) {
171 mode: <em>'local'</em>,
172 triggerAction: <em>'all'</em>
173 });</code></pre></p></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#listeners" ext:member="#listeners" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-local"></a><b><a href="source/GridFilters.html#cfg-Ext.ux.grid.GridFilters-local">local</a></b> : Boolean<div class="mdesc"><tt>true</tt> to use Ext.data.Store filter functions (local filtering)
\r
174 instead of the default (<tt>false</tt>) server side filtering.</div></td><td class="msource">GridFilters</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-menuFilterText"></a><b><a href="source/GridFilters.html#cfg-Ext.ux.grid.GridFilters-menuFilterText">menuFilterText</a></b> : String<div class="mdesc">defaults to <tt>'Filters'</tt>.</div></td><td class="msource">GridFilters</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-paramPrefix"></a><b><a href="source/GridFilters.html#cfg-Ext.ux.grid.GridFilters-paramPrefix">paramPrefix</a></b> : String<div class="mdesc">The url parameter prefix for the filters.
\r
175 Defaults to <tt>'filter'</tt>.</div></td><td class="msource">GridFilters</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-showMenu"></a><b><a href="source/GridFilters.html#cfg-Ext.ux.grid.GridFilters-showMenu">showMenu</a></b> : Boolean<div class="mdesc">Defaults to true, including a filter submenu in the default header menu.</div></td><td class="msource">GridFilters</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-stateId"></a><b><a href="source/GridFilters.html#cfg-Ext.ux.grid.GridFilters-stateId">stateId</a></b> : String<div class="mdesc">Name of the value to be used to store state information.</div></td><td class="msource">GridFilters</td></tr><tr class="config-row "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-updateBuffer"></a><b><a href="source/GridFilters.html#cfg-Ext.ux.grid.GridFilters-updateBuffer">updateBuffer</a></b> : Integer<div class="mdesc">Number of milliseconds to defer store updates since the last filter change.</div></td><td class="msource">GridFilters</td></tr></tbody></table><a id="Ext.ux.grid.GridFilters-props"></a><h2>Public Properties</h2><div class="no-members">This class has no public properties.</div><a id="Ext.ux.grid.GridFilters-methods"></a><h2>Public Methods</h2><table cellspacing="0" class="member-table"><tbody><tr><th colspan="2" class="sig-header">Method</th><th class="msource-header">Defined By</th></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-addEvents"></a><b><a href="source/Observable.html#method-Ext.util.Observable-addEvents">addEvents</a></b>( <code>Object|String o</code>, <code>string Optional.</code> )
\r
177 void<div class="mdesc"><div class="short">Adds the specified events to the list of events which this Observable may fire.</div><div class="long">Adds the specified events to the list of events which this Observable may fire.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>o</code> : Object|String<div class="sub-desc">Either an object with event names as properties with a value of <code>true</code>
178 or the first event name string if multiple event names are being passed as separate parameters.</div></li><li><code>Optional.</code> : string<div class="sub-desc">Event name if multiple event names are being passed as separate parameters.
179 Usage:<pre><code>this.addEvents(<em>'storeloaded'</em>, <em>'storecleared'</em>);</code></pre></div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#addEvents" ext:member="#addEvents" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-addFilter"></a><b><a href="source/GridFilters.html#method-Ext.ux.grid.GridFilters-addFilter">addFilter</a></b>( <code>Object/Ext.ux.grid.filter.Filter config</code> )
\r
181 Ext.ux.grid.filter.Filter<div class="mdesc"><div class="short">Adds a filter to the collection and observes it for state change.</div><div class="long">Adds a filter to the collection and observes it for state change.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>config</code> : Object/Ext.ux.grid.filter.Filter<div class="sub-desc">A filter configuration or a filter object.</div></li></ul><strong>Returns:</strong><ul><li><code>Ext.ux.grid.filter.Filter</code><div class="sub-desc">The existing or newly created filter object.</div></li></ul></div></div></div></td><td class="msource">GridFilters</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-addFilters"></a><b><a href="source/GridFilters.html#method-Ext.ux.grid.GridFilters-addFilters">addFilters</a></b>( <code>Array/Ext.grid.ColumnModel filters</code> )
\r
183 void<div class="mdesc"><div class="short">Adds filters to the collection.</div><div class="long">Adds filters to the collection.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>filters</code> : Array/Ext.grid.ColumnModel<div class="sub-desc">Either an Array of
\r
184 filter configuration objects or an Ext.grid.ColumnModel. The columns
\r
185 of a passed Ext.grid.ColumnModel will be examined for a <code>filter</code>
\r
186 property and, if present, will be used as the filter configuration object.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">GridFilters</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-addListener"></a><b><a href="source/Observable.html#method-Ext.util.Observable-addListener">addListener</a></b>( <code>String eventName</code>, <code>Function handler</code>, <span title="Optional" class="optional">[<code>Object scope</code>]</span>, <span title="Optional" class="optional">[<code>Object options</code>]</span> )
\r
188 void<div class="mdesc"><div class="short">Appends an event handler to this object.</div><div class="long">Appends an event handler to this object.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to listen for.</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes.</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<code><b>this</b></code> reference) in which the handler function is executed.
189 <b>If omitted, defaults to the object which fired the event.</b></div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration.
190 properties. This may contain any of the following properties:<ul>
191 <li><b>scope</b> : Object<div class="sub-desc">The scope (<code><b>this</b></code> reference) in which the handler function is executed.
192 <b>If omitted, defaults to the object which fired the event.</b></div></li>
193 <li><b>delay</b> : Number<div class="sub-desc">The number of milliseconds to delay the invocation of the handler after the event fires.</div></li>
194 <li><b>single</b> : Boolean<div class="sub-desc">True to add a handler to handle just the next firing of the event, and then remove itself.</div></li>
195 <li><b>buffer</b> : Number<div class="sub-desc">Causes the handler to be scheduled to run in an <a href="output/Ext.util.DelayedTask.html" ext:cls="Ext.util.DelayedTask">Ext.util.DelayedTask</a> delayed
196 by the specified number of milliseconds. If the event fires again within that time, the original
197 handler is <em>not</em> invoked, but the new handler is scheduled in its place.</div></li>
198 <li><b>target</b> : Observable<div class="sub-desc">Only call the handler if the event was fired on the target Observable, <i>not</i>
199 if the event was bubbled up from a child Observable.</div></li>
202 <b>Combining Options</b><br>
203 Using the options argument, it is possible to combine different types of listeners:<br>
205 A delayed, one-time listener.
206 <pre><code>myDataView.on(<em>'click'</em>, this.onClick, this, {
211 <b>Attaching multiple handlers in 1 call</b><br>
212 The method also allows for a single argument to be passed which is a config object containing properties
213 which specify multiple handlers.
215 <pre><code>myGridPanel.on({
221 <em>'mouseover'</em> : {
222 fn: this.onMouseOver,
225 <em>'mouseout'</em> : {
231 Or a shorthand syntax:<br>
232 <pre><code>myGridPanel.on({
233 <em>'click'</em> : this.onClick,
234 <em>'mouseover'</em> : this.onMouseOver,
235 <em>'mouseout'</em> : this.onMouseOut,
237 });</code></pre></div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#addListener" ext:member="#addListener" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-bindStore"></a><b><a href="source/GridFilters.html#method-Ext.ux.grid.GridFilters-bindStore">bindStore</a></b>( <code>Store store</code> )
\r
239 void<div class="mdesc"><div class="short">Changes the data store bound to this view and refreshes it.</div><div class="long">Changes the data store bound to this view and refreshes it.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>store</code> : Store<div class="sub-desc">The store to bind to this view</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">GridFilters</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-buildQuery"></a><b><a href="source/GridFilters.html#method-Ext.ux.grid.GridFilters-buildQuery">buildQuery</a></b>( <code>Array filters</code> )
\r
241 Object<div class="mdesc"><div class="short">Function to take the active filters data and build it into a query.
\r
242 The format of the query depends on the encode
\r
243 c...</div><div class="long">Function to take the active filters data and build it into a query.
\r
244 The format of the query depends on the <code><a href="output/Ext.ux.grid.GridFilters.html#Ext.ux.grid.GridFilters-encode" ext:member="encode" ext:cls="Ext.ux.grid.GridFilters">encode</a></code>
\r
246 <div class="mdetail-params"><ul>
\r
247 <li><b><tt>false</tt></b> : <i>Default</i>
\r
248 <div class="sub-desc">
\r
249 Flatten into query string of the form (assuming <code><a href="output/Ext.ux.grid.GridFilters.html#Ext.ux.grid.GridFilters-paramPrefix" ext:member="paramPrefix" ext:cls="Ext.ux.grid.GridFilters">paramPrefix</a>=<em>'filters'</em></code>:
\r
250 <pre><code>filters[0][field]=<em>"someDataIndex"</em>&
\r
251 filters[0][data][comparison]=<em>"someValue1"</em>&
\r
252 filters[0][data][type]=<em>"someValue2"</em>&
\r
253 filters[0][data][value]=<em>"someValue3"</em>&</code></pre>
\r
255 <li><b><tt>true</tt></b> :
\r
256 <div class="sub-desc">
\r
257 JSON encode the filter data
\r
258 <pre><code>filters[0][field]=<em>"someDataIndex"</em>&
\r
259 filters[0][data][comparison]=<em>"someValue1"</em>&
\r
260 filters[0][data][type]=<em>"someValue2"</em>&
\r
261 filters[0][data][value]=<em>"someValue3"</em>&</code></pre>
\r
264 Override this method to customize the format of the filter query for remote requests.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>filters</code> : Array<div class="sub-desc">A collection of objects representing active filters and their configuration.
\r
265 Each element will take the form of {field: dataIndex, data: filterConf}. dataIndex is not assured
\r
266 to be unique as any one filter may be a composite of more basic filters for the same dataIndex.</div></li></ul><strong>Returns:</strong><ul><li><code>Object</code><div class="sub-desc">Query keys and values</div></li></ul></div></div></div></td><td class="msource">GridFilters</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-cleanParams"></a><b><a href="source/GridFilters.html#method-Ext.ux.grid.GridFilters-cleanParams">cleanParams</a></b>( <code>Object p</code> )
\r
268 void<div class="mdesc"><div class="short">Removes filter related query parameters from the provided object.</div><div class="long">Removes filter related query parameters from the provided object.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>p</code> : Object<div class="sub-desc">Query parameters that may contain filter related fields.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">GridFilters</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-clearFilters"></a><b><a href="source/GridFilters.html#method-Ext.ux.grid.GridFilters-clearFilters">clearFilters</a></b>()
\r
270 void<div class="mdesc"><div class="short">Turns all filters off. This does not clear the configuration information
\r
271 (see removeAll).</div><div class="long">Turns all filters off. This does not clear the configuration information
\r
272 (see <a href="output/Ext.ux.grid.GridFilters.html#Ext.ux.grid.GridFilters-removeAll" ext:member="removeAll" ext:cls="Ext.ux.grid.GridFilters">removeAll</a>).<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">GridFilters</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-enableBubble"></a><b><a href="source/Observable-more.html#method-Ext.util.Observable-enableBubble">enableBubble</a></b>( <code>Object events</code> )
\r
274 void<div class="mdesc"><div class="short">Enables events fired by this Observable to bubble up an owner hierarchy by calling
\r
275 this.getBubbleTarget() if present...</div><div class="long"><p>Enables events fired by this Observable to bubble up an owner hierarchy by calling
\r
276 <code>this.getBubbleTarget()</code> if present. There is no implementation in the Observable base class.</p>
\r
277 <p>This is commonly used by Ext.Components to bubble events to owner Containers. See <a href="output/Ext.Component.getBubbleTarget.html" ext:cls="Ext.Component.getBubbleTarget">Ext.Component.getBubbleTarget</a>. The default
\r
278 implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to
\r
279 access the required target more quickly.</p>
\r
280 <p>Example:</p><pre><code>Ext.override(Ext.form.Field, {
\r
281 <i>// Add functionality to Field<em>'s initComponent to enable the change event to bubble
\r</i>
282 initComponent: Ext.form.Field.prototype.initComponent.createSequence(<b>function</b>() {
\r
283 this.enableBubble('</em>change<em>');
\r
286 <i>// We know that we want Field'</em>s events to bubble directly to the FormPanel.
\r</i>
287 getBubbleTarget: <b>function</b>() {
\r
288 <b>if</b> (!this.formPanel) {
\r
289 this.formPanel = this.findParentByType(<em>'form'</em>);
\r
291 <b>return</b> this.formPanel;
\r
295 <b>var</b> myForm = <b>new</b> Ext.formPanel({
\r
296 title: <em>'User Details'</em>,
\r
301 change: <b>function</b>() {
\r
302 <i>// Title goes red <b>if</b> form has been modified.
\r</i>
303 myForm.header.setStyle(<em>"color"</em>, <em>"red"</em>);
\r
306 });</code></pre><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>events</code> : Object<div class="sub-desc">The event name to bubble, or an Array of event names.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#enableBubble" ext:member="#enableBubble" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-fireEvent"></a><b><a href="source/Observable.html#method-Ext.util.Observable-fireEvent">fireEvent</a></b>( <code>String eventName</code>, <code>Object... args</code> )
\r
308 Boolean<div class="mdesc"><div class="short">Fires the specified event with the passed parameters (minus the event name).
\r
309 An event may be set to bubble up an Obse...</div><div class="long"><p>Fires the specified event with the passed parameters (minus the event name).</p>
310 <p>An event may be set to bubble up an Observable parent hierarchy (See <a href="output/Ext.Component.html#Ext.Component-getBubbleTarget" ext:member="getBubbleTarget" ext:cls="Ext.Component">Ext.Component.getBubbleTarget</a>)
311 by calling <a href="output/Ext.util.Observable.html#Ext.util.Observable-enableBubble" ext:member="enableBubble" ext:cls="Ext.util.Observable">enableBubble</a>.</p><div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to fire.</div></li><li><code>args</code> : Object...<div class="sub-desc">Variable number of parameters are passed to handlers.</div></li></ul><strong>Returns:</strong><ul><li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true.</div></li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#fireEvent" ext:member="#fireEvent" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-getFilter"></a><b><a href="source/GridFilters.html#method-Ext.ux.grid.GridFilters-getFilter">getFilter</a></b>( <code>String dataIndex</code> )
\r
313 Ext.ux.grid.filter.Filter<div class="mdesc"><div class="short">Returns a filter for the given dataIndex, if one exists.</div><div class="long">Returns a filter for the given dataIndex, if one exists.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>dataIndex</code> : String<div class="sub-desc">The dataIndex of the desired filter object.</div></li></ul><strong>Returns:</strong><ul><li><code>Ext.ux.grid.filter.Filter</code><div class="sub-desc"></div></li></ul></div></div></div></td><td class="msource">GridFilters</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-getFilterClass"></a><b><a href="source/GridFilters.html#method-Ext.ux.grid.GridFilters-getFilterClass">getFilterClass</a></b>( <code>String type</code> )
\r
315 Class<div class="mdesc"><div class="short">Function for locating filter classes, overwrite this with your favorite
\r
316 loader to provide dynamic filter loading.</div><div class="long">Function for locating filter classes, overwrite this with your favorite
\r
317 loader to provide dynamic filter loading.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>type</code> : String<div class="sub-desc">The type of filter to load ('Filter' is automatically
\r
318 appended to the passed type; eg, 'string' becomes 'StringFilter').</div></li></ul><strong>Returns:</strong><ul><li><code>Class</code><div class="sub-desc">The Ext.ux.grid.filter.Class</div></li></ul></div></div></div></td><td class="msource">GridFilters</td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-getFilterData"></a><b><a href="source/GridFilters.html#method-Ext.ux.grid.GridFilters-getFilterData">getFilterData</a></b>()
\r
320 Array<div class="mdesc"><div class="short">Returns an Array of the currently active filters.</div><div class="long">Returns an Array of the currently active filters.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li><code>Array</code><div class="sub-desc">filters Array of the currently active filters.</div></li></ul></div></div></div></td><td class="msource">GridFilters</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-hasListener"></a><b><a href="source/Observable.html#method-Ext.util.Observable-hasListener">hasListener</a></b>( <code>String eventName</code> )
\r
322 Boolean<div class="mdesc"><div class="short">Checks to see if this object has any listeners for a specified event</div><div class="long">Checks to see if this object has any listeners for a specified event<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The name of the event to check for</div></li></ul><strong>Returns:</strong><ul><li><code>Boolean</code><div class="sub-desc">True if the event is being listened for, else false</div></li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#hasListener" ext:member="#hasListener" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-on"></a><b><a href="source/Observable.html#method-Ext.util.Observable-on">on</a></b>( <code>String eventName</code>, <code>Function handler</code>, <span title="Optional" class="optional">[<code>Object scope</code>]</span>, <span title="Optional" class="optional">[<code>Object options</code>]</span> )
\r
324 void<div class="mdesc"><div class="short">Appends an event handler to this object (shorthand for addListener.)</div><div class="long">Appends an event handler to this object (shorthand for <a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a>.)<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<code><b>this</b></code> reference) in which the handler function is executed.
325 <b>If omitted, defaults to the object which fired the event.</b></div></li><li><code>options</code> : Object<div class="sub-desc">(optional) An object containing handler configuration.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#on" ext:member="#on" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-purgeListeners"></a><b><a href="source/Observable.html#method-Ext.util.Observable-purgeListeners">purgeListeners</a></b>()
\r
327 void<div class="mdesc"><div class="short">Removes all listeners for this object</div><div class="long">Removes all listeners for this object<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#purgeListeners" ext:member="#purgeListeners" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-relayEvents"></a><b><a href="source/Observable-more.html#method-Ext.util.Observable-relayEvents">relayEvents</a></b>( <code>Object o</code>, <code>Array events</code> )
\r
329 void<div class="mdesc"><div class="short">Relays selected events from the specified Observable as if the events were fired by this.</div><div class="long">Relays selected events from the specified Observable as if the events were fired by <tt><b>this</b></tt>.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>o</code> : Object<div class="sub-desc">The Observable whose events this object is to relay.</div></li><li><code>events</code> : Array<div class="sub-desc">Array of event names to relay.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#relayEvents" ext:member="#relayEvents" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-removeAll"></a><b><a href="source/GridFilters.html#method-Ext.ux.grid.GridFilters-removeAll">removeAll</a></b>()
\r
331 void<div class="mdesc"><div class="short">Remove all filters, permanently destroying them.</div><div class="long">Remove all filters, permanently destroying them.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">GridFilters</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-removeListener"></a><b><a href="source/Observable.html#method-Ext.util.Observable-removeListener">removeListener</a></b>( <code>String eventName</code>, <code>Function handler</code>, <span title="Optional" class="optional">[<code>Object scope</code>]</span> )
\r
333 void<div class="mdesc"><div class="short">Removes an event handler.</div><div class="long">Removes an event handler.<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The type of event the handler was associated with.</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove. <b>This must be a reference to the function passed into the <a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a> call.</b></div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope originally specified for the handler.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#removeListener" ext:member="#removeListener" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-resumeEvents"></a><b><a href="source/Observable.html#method-Ext.util.Observable-resumeEvents">resumeEvents</a></b>()
\r
335 void<div class="mdesc"><div class="short">Resume firing events. (see suspendEvents)
\r
336 If events were suspended using the queueSuspended parameter, then all
\r
337 event...</div><div class="long">Resume firing events. (see <a href="output/Ext.util.Observable.html#Ext.util.Observable-suspendEvents" ext:member="suspendEvents" ext:cls="Ext.util.Observable">suspendEvents</a>)
338 If events were suspended using the <tt><b>queueSuspended</b></tt> parameter, then all
339 events fired during event suspension will be sent to any listeners now.<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#resumeEvents" ext:member="#resumeEvents" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-saveState"></a><b><a href="source/GridFilters.html#method-Ext.ux.grid.GridFilters-saveState">saveState</a></b>( <code>Object grid</code>, <code>Object state</code> )
\r
341 Boolean<div class="mdesc"><div class="short">Saves the state of all active filters</div><div class="long">Saves the state of all active filters<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>grid</code> : Object<div class="sub-desc"></div></li><li><code>state</code> : Object<div class="sub-desc"></div></li></ul><strong>Returns:</strong><ul><li><code>Boolean</code><div class="sub-desc"></div></li></ul></div></div></div></td><td class="msource">GridFilters</td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-suspendEvents"></a><b><a href="source/Observable.html#method-Ext.util.Observable-suspendEvents">suspendEvents</a></b>( <code>Boolean queueSuspended</code> )
\r
343 void<div class="mdesc"><div class="short">Suspend the firing of all events. (see resumeEvents)</div><div class="long">Suspend the firing of all events. (see <a href="output/Ext.util.Observable.html#Ext.util.Observable-resumeEvents" ext:member="resumeEvents" ext:cls="Ext.util.Observable">resumeEvents</a>)<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>queueSuspended</code> : Boolean<div class="sub-desc">Pass as true to queue up suspended events to be fired
344 after the <a href="output/Ext.util.Observable.html#Ext.util.Observable-resumeEvents" ext:member="resumeEvents" ext:cls="Ext.util.Observable">resumeEvents</a> call instead of discarding all suspended events;</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#suspendEvents" ext:member="#suspendEvents" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable inherited"><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.util.Observable-un"></a><b><a href="source/Observable.html#method-Ext.util.Observable-un">un</a></b>( <code>String eventName</code>, <code>Function handler</code>, <span title="Optional" class="optional">[<code>Object scope</code>]</span> )
\r
346 void<div class="mdesc"><div class="short">Removes an event handler (shorthand for removeListener.)</div><div class="long">Removes an event handler (shorthand for <a href="output/Ext.util.Observable.html#Ext.util.Observable-removeListener" ext:member="removeListener" ext:cls="Ext.util.Observable">removeListener</a>.)<div class="mdetail-params"><strong>Parameters:</strong><ul><li><code>eventName</code> : String<div class="sub-desc">The type of event the handler was associated with.</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove. <b>This must be a reference to the function passed into the <a href="output/Ext.util.Observable.html#Ext.util.Observable-addListener" ext:member="addListener" ext:cls="Ext.util.Observable">addListener</a> call.</b></div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope originally specified for the handler.</div></li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource"><a href="output/Ext.util.Observable.html#un" ext:member="#un" ext:cls="Ext.util.Observable">Observable</a></td></tr><tr class="method-row expandable "><td class="micon"><a href="#expand" class="exi"> </a></td><td class="sig"><a id="Ext.ux.grid.GridFilters-updateColumnHeadings"></a><b><a href="source/GridFilters.html#method-Ext.ux.grid.GridFilters-updateColumnHeadings">updateColumnHeadings</a></b>()
\r
348 void<div class="mdesc"><div class="short">Update the styles for the header row based on the active filters</div><div class="long">Update the styles for the header row based on the active filters<div class="mdetail-params"><strong>Parameters:</strong><ul><li>None.</li></ul><strong>Returns:</strong><ul><li>void</li></ul></div></div></div></td><td class="msource">GridFilters</td></tr></tbody></table><a id="Ext.ux.grid.GridFilters-events"></a><h2>Public Events</h2><div class="no-members">This class has no public events.</div></div>