ChecklistFilterCombo
A specialized Combo box that displays its items as a list of checkboxes with a search field and "remove all" button, used for filtering data in Grid columns.
//<code-header>
fiddle.title = 'Checklist filter combo';
//</code-header>
new ChecklistFilterCombo({
width : '25em',
appendTo : targetElement,
displayField : 'city',
valueField : 'city',
value : ['Paris'],
store : {
fields : [
'city'
],
data : [
{ city : 'Stockholm' },
{ city : 'Barcelona' },
{ city : 'Paris' },
{ city : 'Dubai' },
{ city : 'New York' },
{ city : 'San Francisco' },
{ city : 'Washington' },
{ city : 'Montreal' }
]
}
});To customize its contents you can:
- Supply listItemPillTpl to render additional information in a pill alongside search results
- Override listItemTpl to fully control item rendering
- Configure showApplyButton to control when
changeevents are fired - Reconfigure built-in widgets by providing override configs in the picker config's
tbar,bbar, anditems - Configure the store to change sorting of results
-
Built-in widgets
The built-in tbar widgets are:
| Widget ref | Type | Weight | Description |
|---|---|---|---|
searchField |
TextField | 100 | Search the list (in tbar) |
The built-in items widgets are:
| Widget ref | Type | Weight | Description |
|---|---|---|---|
list |
List | 100 | List of selectable options |
The built-in bbar buttons are:
| Widget ref | Type | Weight | Description |
|---|---|---|---|
applyButton |
Button | 100 | Apply button, on the bbar, updates field value from list selection |
selectAllButton |
Button | 200 | Select All button, on the bbar, selects all list items |
removeAllButton |
Button | 300 | Remove All button, on the bbar, clears all list selections |
Removing a built-in item
To remove a built-in widget, specify its ref as null in the items, tbar.items, or bbar.items config:
{
type : 'checklistfiltercombo',
bbar : {
items : {
selectAllButton : null // Remove the selectAllButton
}
}
}
Customizing a built-in widget
To customize a built-in widget, use its ref as the key in the items config and specify the configs you want
to change (they will merge with the widgets default configs):
{
type : 'checklistfiltercombo',
tbar : {
items : {
searchField : {
placeholder : 'Search items...'
}
}
}
}
Use with the FilterBar feature
To use a ChecklistFilterCombo as the filtering UI for a Grid column when using the FilterBar feature,
specify it using type in the filterField config inside the column's filterable config:
{
text : 'City',
field : 'city',
filterable : {
filterField : {
type : 'checklistfiltercombo',
operator : 'isIncludedIn'
// ...any further ChecklistFilterCombo configs
}
}
},
Note the use of the 'isIncludedIn' operator on the filterField to get the expected "or" behavior.
Configs
148
Configs
148Other
Template to render optional content next to list items.
| Parameter | Type | Description |
|---|---|---|
record | Model | The list item's backing record |
The text in the search box, which will filter the list to matching records only. See also filterOperator.
When true, shows an "Apply" button in place of the "Select All" button, and does not
raise change events until the Apply button is clicked.
The initial value of this Combo box. An array of record ids.
DOM
Float & align
Input element
Label
Layout
Misc
Scrolling
Properties
100
Properties
100Class hierarchy
Other
Template to render optional content next to list items.
| Parameter | Type | Description |
|---|---|---|
record | Model | The list item's backing record |
The text in the search box, which will filter the list to matching records only. See also filterOperator.
When true, shows an "Apply" button in place of the "Select All" button, and does not
raise change events until the Apply button is clicked.