API svyToolbarFilter
Classes
ListComponentFilterRenderer ⇐ AbstractToolbarFilterUX
NgGridListComponentFilterRenderer ⇐ ListComponentFilterRenderer
Members
Functions
createFilterToolbar(listComponent, tableOrFoundSet) ⇒ NgGridListComponentFilterRenderer
Creates a filter toolbar implementation using the custom list from the custom-rendered-components package.
This implementation expects an NG "Data Grid" table component and a "Custom List" component.
The filters offered from this implementation are generated from the table provided as follows:
any column with its
filterType
property set to TEXT will be offered as a token popup, allowing the user to enter any number of Strings to matchany column with its
filterType
property set to TEXT and thevaluelist
will be offered as a lookup where the user can search for and select any number of valuesany column with its
filterType
property set to NUMBER will be offered as a number filter with a number of operatorsany column with its
filterType
property set to DATE will be offered as a date filter with a number of operators
You should create a toolbar filter instance at the onLoad of your form and assign it to a form variable.
Make sure to re-direct the onClick event of the "List Component" to the toolbar.onClick(entry, index, dataTarget, event);
createSimpleFilterToolbar(listComponent, [foundsetToFilter]) ⇒ ListComponentFilterRenderer
Creates a filter toolbar implementation using the custom list from the custom-rendered-components package.
This implementation expects a "Custom List" component. An optional foundset to be filtered can be provided. If not given, the foundset of the form of the given list component is used.
Filters to be offered need to be added via the API method addFilter(titleText, dataProvider, filterType)
.
You should create a toolbar filter instance at the onLoad of your form and assign it to a form variable.
Make sure to re-direct the onClick event of the "List Component" to the toolbar.onClick(entry, index, dataTarget, event);
getConfigSortPickerAlphabetically() ⇒ Boolean
Returns true if the filter picker is sorted alphabetically
setConfigDateDisplayFormat(displayFormat)
Sets global display date format to be used
setConfigSortPickerAlphabetically(sortAlphabetically)
Sort the the filter picker alphabetically. Default sort is based on column's position in grid.
setConfigUseNonVisibleColumns(useNonVisibleColumns)
Use only visible columns of the grid when set to false
setPopupDefaultOperator(formType, operator)
setPopupRendererForm(formType, form)
ListComponentFilterRenderer ⇐ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Extends: AbstractToolbarFilterUX
ListComponentFilterRenderer ⇐
AbstractToolbarFilterUX
.applyFilters() ⇒
Boolean
.clearFilterUI() ⇒
Boolean
.getActiveFilters() ⇒
[ 'Array' ].<scopes.svyPopupFilter.AbstractPopupFilter>
.getDataSource() ⇒
String
.getDefaultSearch() ⇒
scopes.svySearch.SimpleSearch
.getElement() ⇒
RuntimeComponent
.getFoundSet() ⇒
JSFoundSet
.getQuery() ⇒
QBSelect
.getSearchProvider(columnOrDataProvider) ⇒
scopes.svySearch.SearchProvider
.getSearchText() ⇒
String
.getSimpleSearch() ⇒
scopes.svySearch.SimpleSearch
.getToolbarFiltersState() ⇒
[ 'Array' ].<{id: String, dataprovider: String, operator: String, params: Object, text: String, values: Array}>
.hasFilters() ⇒
Boolean
.autoApply :
Boolean
listComponentFilterRenderer.addFilter(titleText, dataProvider, filterType) ⇒ Filter
Filter
listComponentFilterRenderer.applyFilters() ⇒ Boolean
Boolean
Applies all filters
Returns: Boolean
- true if records are loaded, false otherwise
listComponentFilterRenderer.clearFilterUI() ⇒ Boolean
Boolean
Clears all filters from the UI and fires the onFilterRemovedEvent
listComponentFilterRenderer.executeSearch([searchText])
Executes the search
listComponentFilterRenderer.getActiveFilters() ⇒ [ 'Array' ].<scopes.svyPopupFilter.AbstractPopupFilter>
[ 'Array' ].<scopes.svyPopupFilter.AbstractPopupFilter>
listComponentFilterRenderer.getDataSource() ⇒ String
String
Returns the datasource to be filtered as the datasource of the form the filter UI Component is on
This method can be overwritten by subclasses to return for example the datasource of an NG Grid
listComponentFilterRenderer.getDefaultSearch() ⇒ scopes.svySearch.SimpleSearch
scopes.svySearch.SimpleSearch
listComponentFilterRenderer.getElement() ⇒ RuntimeComponent
RuntimeComponent
Returns the element used to display the filters
Overrides: getElement
listComponentFilterRenderer.getFilter(dataprovider) ⇒ Filter
Filter
Returns the Filter for the given dataprovider
listComponentFilterRenderer.getFilters() ⇒ [ 'Array' ].<Filter>
[ 'Array' ].<Filter>
listComponentFilterRenderer.getFoundSet() ⇒ JSFoundSet
JSFoundSet
Returns the foundset to be filtered as the foundset of the form the filter UI Component is on
This method can be overwritten by subclasses to return for example the foundset of an NG Grid
listComponentFilterRenderer.getQuery() ⇒ QBSelect
QBSelect
Applies all filters and returns the query for this toolbar
listComponentFilterRenderer.getSearchProvider(columnOrDataProvider) ⇒ scopes.svySearch.SearchProvider
scopes.svySearch.SearchProvider
Returns the SearchProvider for the given column or dataprovider
listComponentFilterRenderer.getSearchText() ⇒ String
String
Returns the search text for the simple search
listComponentFilterRenderer.getSimpleSearch() ⇒ scopes.svySearch.SimpleSearch
scopes.svySearch.SimpleSearch
Returns the SimpleSearch
listComponentFilterRenderer.getToolbarFiltersState() ⇒ [ 'Array' ].<{id: String, dataprovider: String, operator: String, params: Object, text: String, values: Array}>
[ 'Array' ].<{id: String, dataprovider: String, operator: String, params: Object, text: String, values: Array}>
Returns the filters' state of the toolbar
Returns: [ 'Array' ].<{id: String, dataprovider: String, operator: String, params: Object, text: String, values: Array}>
- jsonState
listComponentFilterRenderer.hasFilters() ⇒ Boolean
Boolean
Returns true if the toolbar has any dataprovider it can filter on
listComponentFilterRenderer.onClick(entry, index, dataTarget, event)
Called when the mouse is clicked on a list entry.
listComponentFilterRenderer.removeFilter(filter)
Removes the given filter
listComponentFilterRenderer.restoreToolbarFiltersState(jsonState)
Restores the filters' state
listComponentFilterRenderer.search([searchText])
Applies all filters and executes the search
listComponentFilterRenderer.setAutoApplyFilters(autoApply) ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
listComponentFilterRenderer.setFilterValue(filter, values, operator)
Sets a filter value for the given filter
listComponentFilterRenderer.setOnFilterAddedCallback(callback) ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Sets a callback method that is fired whenever a filter has been added
The callback method receives the Filter object of the filter added as argument
listComponentFilterRenderer.setOnFilterApplyCallback(callback) ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Sets a callback method that is fired whenever the filter is applied The callback method receives an array of values, the operator and the filter as arguments
listComponentFilterRenderer.setOnFilterApplyQueryCondition(callback) ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Sets a callback method that is fired whenever a query for a given filter is applied
This can be used to either modify the filter before the query is created or to enhance the provided QBSelect yourself
To prevent the filter from adding criteria to the query as it would normally do, the method being called can return false
The method called receives these parameters
@param {QBSelect} qbSelect the query to enhance
@param {String} dataprovider the column/dataprovider of this filter
@param {String} operator the operator used
@param {Array} values the filter's values
@param {scopes.svyPopupFilter.AbstractPopupFilter} filter the filter object
listComponentFilterRenderer.setOnFilterCreate(callback) ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Allows to provide a method that will be called when the filter UI for a specific dataprovider is created That method then can create and return any filter that will then be used for this column
listComponentFilterRenderer.setOnFilterRemovedCallback(callback) ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Sets a callback method that is fired whenever a filter is removed
listComponentFilterRenderer.setOnSearchCommand(callback) ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Set the onSearchCommand function to override the search behavior. You can add custom conditions to the filter query object;
Example
listComponentFilterRenderer.setSearchText() ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Sets the search text for the simple search
listComponentFilterRenderer.showPopupFilterPicker(target)
Shows the filter picker popup
listComponentFilterRenderer.autoApply : Boolean
Boolean
listComponentFilterRenderer.filters : [ 'Array' ].<Filter>
[ 'Array' ].<Filter>
new ListComponentFilterRenderer(listComponent, [foundsetToFilter])
Filter Toolbar implementation using the custom list from the custom-rendered-components package. This implementation requires a "List Component" element and a foundset to filter. You should create a toolbar filter instance at the onLoad of your form and assign it to a form variable. Make sure to re-direct the onClick event of the "List Component" to the toolbar.onClick(entry, index, dataTarget, event);
Example
NgGridListComponentFilterRenderer ⇐ ListComponentFilterRenderer
ListComponentFilterRenderer
Extends: ListComponentFilterRenderer
NgGridListComponentFilterRenderer ⇐
ListComponentFilterRenderer
.applyFilters() ⇒
Boolean
.clearFilterUI() ⇒
Boolean
.getActiveFilters() ⇒
[ 'Array' ].<scopes.svyPopupFilter.AbstractPopupFilter>
.getDataSource() ⇒
String
.getDefaultSearch() ⇒
scopes.svySearch.SimpleSearch
.getElement() ⇒
RuntimeComponent
.getFoundSet() ⇒
JSFoundSet
.getQuery() ⇒
QBSelect
.getSearchProvider(columnOrDataProvider) ⇒
scopes.svySearch.SearchProvider
.getSearchText() ⇒
String
.getSimpleSearch() ⇒
scopes.svySearch.SimpleSearch
.getToolbarFiltersState() ⇒
[ 'Array' ].<{id: String, dataprovider: String, operator: String, params: Object, text: String, values: Array}>
.hasFilters() ⇒
Boolean
.autoApply :
Boolean
ngGridListComponentFilterRenderer.addFilter(titleText, dataProvider, filterType) ⇒ Filter
Filter
ngGridListComponentFilterRenderer.applyFilters() ⇒ Boolean
Boolean
Applies all filters
Returns: Boolean
- true if records are loaded, false otherwise
ngGridListComponentFilterRenderer.clearFilterUI() ⇒ Boolean
Boolean
Clears all filters from the UI and fires the onFilterRemovedEvent
ngGridListComponentFilterRenderer.executeSearch([searchText])
Executes the search
ngGridListComponentFilterRenderer.getActiveFilters() ⇒ [ 'Array' ].<scopes.svyPopupFilter.AbstractPopupFilter>
[ 'Array' ].<scopes.svyPopupFilter.AbstractPopupFilter>
ngGridListComponentFilterRenderer.getDataSource() ⇒ String
String
Returns the datasource to be filtered as the datasource of the NG Grid
Overrides: getDataSource
ngGridListComponentFilterRenderer.getDefaultSearch() ⇒ scopes.svySearch.SimpleSearch
scopes.svySearch.SimpleSearch
ngGridListComponentFilterRenderer.getElement() ⇒ RuntimeComponent
RuntimeComponent
Returns the element used to display the filters
ngGridListComponentFilterRenderer.getFilter(dataprovider) ⇒ Filter
Filter
Returns the Filter for the given dataprovider
ngGridListComponentFilterRenderer.getFilters() ⇒ [ 'Array' ].<Filter>
[ 'Array' ].<Filter>
Returns all filters of this ToolbarFilter
Overrides: getFilters
getFilters~filters
Array
ngGridListComponentFilterRenderer.getFoundSet() ⇒ JSFoundSet
JSFoundSet
Returns the foundset to be filtered as the foundset of the NG Grid
Overrides: getFoundSet
ngGridListComponentFilterRenderer.getQuery() ⇒ QBSelect
QBSelect
Applies all filters and returns the query for this toolbar
ngGridListComponentFilterRenderer.getSearchProvider(columnOrDataProvider) ⇒ scopes.svySearch.SearchProvider
scopes.svySearch.SearchProvider
Returns the SearchProvider for the given column or dataprovider
ngGridListComponentFilterRenderer.getSearchText() ⇒ String
String
Returns the search text for the simple search
ngGridListComponentFilterRenderer.getSimpleSearch() ⇒ scopes.svySearch.SimpleSearch
scopes.svySearch.SimpleSearch
Returns the SimpleSearch
ngGridListComponentFilterRenderer.getToolbarFiltersState() ⇒ [ 'Array' ].<{id: String, dataprovider: String, operator: String, params: Object, text: String, values: Array}>
[ 'Array' ].<{id: String, dataprovider: String, operator: String, params: Object, text: String, values: Array}>
Returns the filters' state of the toolbar
Returns: [ 'Array' ].<{id: String, dataprovider: String, operator: String, params: Object, text: String, values: Array}>
- jsonState
ngGridListComponentFilterRenderer.hasFilters() ⇒ Boolean
Boolean
Returns true if the toolbar has any dataprovider it can filter on
ngGridListComponentFilterRenderer.onClick(entry, index, dataTarget, event)
Called when the mouse is clicked on a list entry.
ngGridListComponentFilterRenderer.removeFilter(filter)
Removes the given filter
ngGridListComponentFilterRenderer.restoreToolbarFiltersState(jsonState)
Restores the filters' state
ngGridListComponentFilterRenderer.search([searchText])
Applies all filters and executes the search
ngGridListComponentFilterRenderer.setAutoApplyFilters(autoApply) ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
ngGridListComponentFilterRenderer.setFilterValue(filter, values, operator)
Sets a filter value for the given filter
ngGridListComponentFilterRenderer.setOnFilterAddedCallback(callback) ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Sets a callback method that is fired whenever a filter has been added
The callback method receives the Filter object of the filter added as argument
ngGridListComponentFilterRenderer.setOnFilterApplyCallback(callback) ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Sets a callback method that is fired whenever the filter is applied The callback method receives an array of values, the operator and the filter as arguments
ngGridListComponentFilterRenderer.setOnFilterApplyQueryCondition(callback) ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Sets a callback method that is fired whenever a query for a given filter is applied
This can be used to either modify the filter before the query is created or to enhance the provided QBSelect yourself
To prevent the filter from adding criteria to the query as it would normally do, the method being called can return false
The method called receives these parameters
@param {QBSelect} qbSelect the query to enhance
@param {String} dataprovider the column/dataprovider of this filter
@param {String} operator the operator used
@param {Array} values the filter's values
@param {scopes.svyPopupFilter.AbstractPopupFilter} filter the filter object
ngGridListComponentFilterRenderer.setOnFilterCreate(callback) ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Allows to provide a method that will be called when the filter UI for a specific dataprovider is created That method then can create and return any filter that will then be used for this column
ngGridListComponentFilterRenderer.setOnFilterRemovedCallback(callback) ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Sets a callback method that is fired whenever a filter is removed
ngGridListComponentFilterRenderer.setOnSearchCommand(callback) ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Set the onSearchCommand function to override the search behavior. You can add custom conditions to the filter query object;
Example
ngGridListComponentFilterRenderer.setSearchText() ⇒ AbstractToolbarFilterUX
AbstractToolbarFilterUX
Sets the search text for the simple search
ngGridListComponentFilterRenderer.showPopupFilterPicker(target)
Shows the filter picker popup
ngGridListComponentFilterRenderer.autoApply : Boolean
Boolean
new NgGridListComponentFilterRenderer(listComponent, tableComponent)
createFilterToolbar(listComponent, tableOrFoundSet) ⇒ NgGridListComponentFilterRenderer
NgGridListComponentFilterRenderer
Creates a filter toolbar implementation using the custom list from the custom-rendered-components package.\
This implementation expects an NG "Data Grid" table component and a "Custom List" component.\
The filters offered from this implementation are generated from the table provided as follows:
any column with its
filterType
property set to TEXT will be offered as a token popup, allowing the user to enter any number of Strings to matchany column with its
filterType
property set to TEXT and thevaluelist
will be offered as a lookup where the user can search for and select any number of valuesany column with its
filterType
property set to NUMBER will be offered as a number filter with a number of operatorsany column with its
filterType
property set to DATE will be offered as a date filter with a number of operators
You should create a toolbar filter instance at the onLoad of your form and assign it to a form variable.
Make sure to re-direct the onClick event of the "List Component" to the toolbar.onClick(entry, index, dataTarget, event);
Example
createSimpleFilterToolbar(listComponent, [foundsetToFilter]) ⇒ ListComponentFilterRenderer
ListComponentFilterRenderer
Creates a filter toolbar implementation using the custom list from the custom-rendered-components package.\
This implementation expects a "Custom List" component. An optional foundset to be filtered can be provided. If not given, the foundset of the form of the given list component is used.\
Filters to be offered need to be added via the API method addFilter(titleText, dataProvider, filterType)
.\
You should create a toolbar filter instance at the onLoad of your form and assign it to a form variable.\
Make sure to re-direct the onClick event of the "List Component" to the toolbar.onClick(entry, index, dataTarget, event);
Example
getConfigSortPickerAlphabetically() ⇒ Boolean
Boolean
Returns true if the filter picker is sorted alphabetically
Since: v1.3.0
setConfigDateDisplayFormat(displayFormat)
Sets global display date format to be used
setConfigSortPickerAlphabetically(sortAlphabetically)
Sort the the filter picker alphabetically. Default sort is based on column's position in grid.
Since: v1.3.0
setConfigUseNonVisibleColumns(useNonVisibleColumns)
Use only visible columns of the grid when set to false
Since: v1.1.0
setPopupDefaultOperator(formType, operator)
Since: v1.1.0
Example
setPopupRendererForm(formType, form)
FILTER_TYPES
FILTER_TYPES.CHECK
Check filter
FILTER_TYPES.DATE
Date filter
FILTER_TYPES.INTEGER
INTEGER filter
FILTER_TYPES.NUMBER
Number filter
FILTER_TYPES.SELECT
Select filter
FILTER_TYPES.TOKEN
Tokens filter
Last updated