Provide filter functionality for grid.
Acceptable plugin parameters:
Acceptable cell parameters defined in layout:
dataTypeArgs: object: Some arguments helping convert store data to something the filter UI understands. Different data type arguments can be provided to different data types. For date/time, this is a dojo.date.locale.__FormatOptions, so the DataTimeBox can understand the store data. For boolean, this object contains:
disabledConditions: object: If you don't need all of the conditions provided by the filter UI on this column, you can explicitly say it out here. e.g.: disabledConditions: ["contains", "is"] This will disable the "contains" condition for this column, if this column is of string type. For full set of conditions, please refer to dojox.grid.enhanced.plugins.filter.FilterDefDialog._setupData.
Parameter | Type | Description |
---|---|---|
grid | undefined | |
args | undefined |
<div dojoType="dojox.grid.EnhancedGrid" plugins="{GridFilter: true}" ...></div> or provide some parameters: <div dojoType="dojox.grid.EnhancedGrid" plugins="{GridFilter: {itemsName: 'songs'}}" ...></div> Customize columns for filter: var layout = [ ... //define a column to be un-filterable in layout/structure {field: "Genre", filterable: false, ...} //define a column of type string and supports autoComplete when you type in filter conditions. {field: "Writer", datatype: "string", autoCommplete: true, ...} //define a column of type date and the data in store has format: "yyyy/M/d" {field: "Publish Date", datatype: "date", dataTypeArgs: {datePattern: "yyyy/M/d"}, ...} //disable some conditions for a column {field: "Track", disabledConditions: ["equalto","notequalto"], ...} ... ];
Plugin properties - leveraged with default and user specified properties. e.g. for dnd plugin, it may look like {"class": dojox.grid.enhanced.plugins.DnD, "dependency": ["nestedSorting"], ...}
Private properties/methods shouldn't be mixin-ed anytime.
Define the grid-specific way to get data from a row. Argument "cell" is provided by FilterDefDialog when defining filter expressions. Argument "rowIndex" is provided by FilterLayer when checking a row. FilterLayer also provides a forth argument: "store", which is grid.store, but we don't need it here.
Parameter | Type | Description |
---|---|---|
datarow | data item | |
cell | cell | |
rowIndex | int |
Connects specified obj/event to specified method of this object.
Parameter | Type | Description |
---|---|---|
obj | undefined | |
event | undefined | |
method | undefined |
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when foo.bar() is called, call the listener in the scope of plugin plugin.connect(foo, "bar", function(){ console.debug(this.xxx());//"this" - plugin scope });
Disconnects handle and removes it from connection list.
Parameter | Type | Description |
---|---|---|
handle | undefined |
Subscribes to the specified topic and calls the specified method of this object.
Parameter | Type | Description |
---|---|---|
topic | undefined | |
method | undefined |
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when /my/topic is published, call the subscriber in the scope of plugin // with passed parameter - "v" plugin.subscribe("/my/topic", function(v){ console.debug(this.xxx(v));//"this" - plugin scope });
Un-subscribes handle and removes it from subscriptions list.
Parameter | Type | Description |
---|---|---|
handle | undefined |
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when /my/topic is published, call the subscriber in the scope of plugin // with passed parameter - "v" plugin.subscribe("/my/topic", function(v){ console.debug(this.xxx(v));//"this" - plugin scope });
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when /my/topic is published, call the subscriber in the scope of plugin // with passed parameter - "v" plugin.subscribe("/my/topic", function(v){ console.debug(this.xxx(v));//"this" - plugin scope });
Parameter | Type | Description |
---|---|---|
store | undefined |
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when /my/topic is published, call the subscriber in the scope of plugin // with passed parameter - "v" plugin.subscribe("/my/topic", function(v){ console.debug(this.xxx(v));//"this" - plugin scope });
var plugin = new dojox.grid.enhanced._Plugin(grid,"myPlugin",{...}); // when /my/topic is published, call the subscriber in the scope of plugin // with passed parameter - "v" plugin.subscribe("/my/topic", function(v){ console.debug(this.xxx(v));//"this" - plugin scope });