Properties Methods Events Config Options Direct Link

    Filter
      ListFilter

# Class Ext.ux.grid.filter.ListFilter

Package: | Ext.ux.grid.filter
Defined In: | ListFilter.js
Class: | ListFilter
Extends: | Filter

List filters are able to be preloaded/backed by an Ext.data.Store to load their options the first time they are shown. ListFilter utilizes the Ext.ux.menu.ListMenu component.

Although not shown here, this class accepts all configuration options for Ext.ux.menu.ListMenu.

Example Usage:

    var filters = new Ext.ux.grid.GridFilters({
        ...
        filters: [{
            type: 'list',
            dataIndex: 'size',
            phpMode: true,
            // options will be used as data to implicitly creates an ArrayStore
            options: ['extra small', 'small', 'medium', 'large', 'extra large']
        }]
    });

## Config Options

Config Options | Defined By
--- | ---
| active : Boolean Indicates the initial status of the filter (defaults to false). | Filter
| dataIndex : String The Ext.data.Store dataIndex of the field this filter represents. The dataIndex does not actually have to exist in th... The Ext.data.Store dataIndex of the field this filter represents. The dataIndex does not actually have to exist in the store. | Filter
- | options : Array data to be used to implicitly create a data store to back this list when the data source is local. If the data for th... `data` to be used to implicitly create a data store to back this list when the data source is local. If the data for the list is remote, use the `store` config instead. Each item within the provided array may be in one of the following formats: Array :
      options: [
          [11, 'extra small'],
          [18, 'small'],
          [22, 'medium'],
          [35, 'large'],
          [44, 'extra large']
      ]
- Object :
      labelField: 'name', // override default of 'text'
      options: [
          {id: 11, name:'extra small'},
          {id: 18, name:'small'},
          {id: 22, name:'medium'},
          {id: 35, name:'large'},
          {id: 44, name:'extra large'}
      ]
- String :
      options: ['extra small', 'small', 'medium', 'large', 'extra large']
| ListFilter
- | options : Array data to be used to implicitly create a data store to back this list when the data source is local. If the data for th... `data` to be used to implicitly create a data store to back this list when the data source is local. If the data for the list is remote, use the `store` config instead. Each item within the provided array may be in one of the following formats: Array :
      options: [
          [11, 'extra small'],
          [18, 'small'],
          [22, 'medium'],
          [35, 'large'],
          [44, 'extra large']
      ]
- Object :
      labelField: 'name', // override default of 'text'
      options: [
          {id: 11, name:'extra small'},
          {id: 18, name:'small'},
          {id: 22, name:'medium'},
          {id: 35, name:'large'},
          {id: 44, name:'extra large'}
      ]
- String :
      options: ['extra small', 'small', 'medium', 'large', 'extra large']
| ListFilter
| phpMode : Boolean Adjust the format of this filter. Defaults to false. When GridFilters @cfg encode = false (default): // phpMode == fa... Adjust the format of this filter. Defaults to false. When GridFilters `@cfg encode = false` (default):
    // phpMode == false (default):
    filter[0][data][type] list
    filter[0][data][value] value1
    filter[0][data][value] value2
    filter[0][field] prod

    // phpMode == true:
    filter[0][data][type] list
    filter[0][data][value] value1, value2
    filter[0][field] prod
When GridFilters `@cfg encode = true`:
    // phpMode == false (default):
    filter : [{"type":"list","value":["small","medium"],"field":"size"}]

    // phpMode == true:
    filter : [{"type":"list","value":"small,medium","field":"size"}]
| ListFilter
| phpMode : Boolean Adjust the format of this filter. Defaults to false. When GridFilters @cfg encode = false (default): // phpMode == fa... Adjust the format of this filter. Defaults to false. When GridFilters `@cfg encode = false` (default):
    // phpMode == false (default):
    filter[0][data][type] list
    filter[0][data][value] value1
    filter[0][data][value] value2
    filter[0][field] prod

    // phpMode == true:
    filter[0][data][type] list
    filter[0][data][value] value1, value2
    filter[0][field] prod
When GridFilters `@cfg encode = true`:
    // phpMode == false (default):
    filter : [{"type":"list","value":["small","medium"],"field":"size"}]

    // phpMode == true:
    filter : [{"type":"list","value":"small,medium","field":"size"}]
| ListFilter
| store : Ext.data.Store The Ext.data.Store this list should use as its data source when the data source is remote. If the data for the list i... The Ext.data.Store this list should use as its data source when the data source is remote. If the data for the list is local, use the `options` config instead. | ListFilter
| store : Ext.data.Store The Ext.data.Store this list should use as its data source when the data source is remote. If the data for the list i... The Ext.data.Store this list should use as its data source when the data source is remote. If the data for the list is local, use the `options` config instead. | ListFilter
| updateBuffer : Number Number of milliseconds to wait after user interaction to fire an update. Only supported by filters: 'list', 'numeric... Number of milliseconds to wait after user interaction to fire an update. Only supported by filters: 'list', 'numeric', and 'string'. Defaults to 500. | Filter

## Public Properties

Property | Defined By
--- | ---
| active : Boolean True if this filter is active. Use setActive() to alter after configuration. | Filter
| getSerialArgs : Object Template method to be implemented by all subclasses that is to get and return serialized filter data for transmission... Template method to be implemented by all subclasses that is to get and return serialized filter data for transmission to the server. Defaults to Ext.emptyFn. | Filter
| init : Object Template method to be implemented by all subclasses that is to initialize the filter and install required menu items.... Template method to be implemented by all subclasses that is to initialize the filter and install required menu items. Defaults to Ext.emptyFn. | Filter
| menu : Ext.menu.Menu The filter configuration menu that will be installed into the filter submenu of a column menu. | Filter

## Public Methods

Method | Defined By
--- | ---
| destroy() : void Destroys this filter by purging any event listeners, and removing any menus. Destroys this filter by purging any event listeners, and removing any menus. Parameters: None. Returns: void | Filter
| getValue() : Object Template method to be implemented by all subclasses that is to get and return the value of the filter. Defaults to Ex... Template method to be implemented by all subclasses that is to get and return the value of the filter. Defaults to Ext.emptyFn. Parameters: None. Returns: `Object` The 'serialized' form of this filter | Filter
| isActivatable() : Boolean Template method to be implemented by all subclasses that is to return true if the filter has enough configuration inf... Template method to be implemented by all subclasses that is to return `true` if the filter has enough configuration information to be activated. Defaults to `return true`. Parameters: None. Returns: `Boolean` | Filter
| serialize() : Object/Array Returns the serialized filter data for transmission to the server and fires the 'serialize' event. Returns the serialized filter data for transmission to the server and fires the 'serialize' event. Parameters: None. Returns: `Object/Array` An object or collection of objects containing key value pairs representing the current configuration of the filter. | Filter
| setActive( `Boolean active`, `Boolean suppressEvent` ) : void Sets the status of the filter and fires the appropriate events. Sets the status of the filter and fires the appropriate events. Parameters: `active` : Boolean The new filter state. `suppressEvent` : Boolean True to prevent events from being fired. Returns: void | Filter
| setValue( `Object data` ) : void Template method to be implemented by all subclasses that is to set the value of the filter and fire the 'update' even... Template method to be implemented by all subclasses that is to set the value of the filter and fire the 'update' event. Defaults to Ext.emptyFn. Parameters: `data` : Object The value to set the filter Returns: void | Filter
| validateRecord( `Ext.data.Record record` ) : Boolean Template method that is to validate the provided Ext.data.Record against the filters configuration. Template method that is to validate the provided Ext.data.Record against the filters configuration. Parameters: `record` : Ext.data.Record The record to validate Returns: `Boolean` true if the record is valid within the bounds of the filter, false otherwise. | ListFilter

## Public Events

Event | Defined By
--- | ---
| activate : ( `Ext.ux.grid.filter.Filter this` ) Fires when an inactive filter becomes active Fires when an inactive filter becomes active Listeners will be called with the following arguments: `this` : Ext.ux.grid.filter.Filter | Filter
| deactivate : ( `Ext.ux.grid.filter.Filter this` ) Fires when an active filter becomes inactive Fires when an active filter becomes inactive Listeners will be called with the following arguments: `this` : Ext.ux.grid.filter.Filter | Filter
| serialize : ( `Array/Object data`, `Ext.ux.grid.filter.Filter filter` ) Fires after the serialization process. Use this to attach additional parameters to serialization data before it is en... Fires after the serialization process. Use this to attach additional parameters to serialization data before it is encoded and sent to the server. Listeners will be called with the following arguments: `data` : Array/Object A map or collection of maps representing the current filter configuration. `filter` : Ext.ux.grid.filter.Filter The filter being serialized. | Filter
| update : ( `Ext.ux.grid.filter.Filter this` ) Fires when a filter configuration has changed Fires when a filter configuration has changed Listeners will be called with the following arguments: `this` : Ext.ux.grid.filter.Filter The filter object. | Filter