API svyToolbarFilter
Last updated
Was this helpful?
Last updated
Was this helpful?
⇐ ⇐
⇒
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 match
any column with its filterType
property set to TEXT and the valuelist
will be offered as a lookup where the user can search for and select any number of values
any column with its filterType
property set to NUMBER will be offered as a number filter with a number of operators
any 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);
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);
Returns true if the filter picker is sorted alphabetically
Sets global display date format to be used
Sort the the filter picker alphabetically. Default sort is based on column's position in grid.
Use only visible columns of the grid when set to false
titleText
String
dataProvider
String
filterType
String
any of the FILTER_TYPES enum values
Boolean
Applies all filters
Returns: Boolean
- true if records are loaded, false otherwise
Boolean
Clears all filters from the UI and fires the onFilterRemovedEvent
Executes the search
[searchText]
String
optional searchText to search for; if not provided here, call setSearchText() to set the search criteria before performing the search
[ 'Array' ].<scopes.svyPopupFilter.AbstractPopupFilter>
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
scopes.svySearch.SimpleSearch
RuntimeComponent
Returns the element used to display the filters
Returns the Filter for the given dataprovider
dataprovider
String
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
QBSelect
Applies all filters and returns the query for this toolbar
scopes.svySearch.SearchProvider
Returns the SearchProvider for the given column or dataprovider
columnOrDataProvider
CustomType.<aggrid-groupingtable.column>
| String
String
Returns the search text for the simple search
scopes.svySearch.SimpleSearch
Returns the SimpleSearch
[ '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
Boolean
Returns true if the toolbar has any dataprovider it can filter on
Called when the mouse is clicked on a list entry.
entry
object
index
Number
dataTarget
string
event
JSEvent
Removes the given filter
filter
Restores the filters' state
jsonState
[ 'Array' ].<{id: String, dataprovider: String, operator: String, params: Object, text: String, values: Array}>
Applies all filters and executes the search
[searchText]
String
optional searchText to search for; if not provided here, call setSearchText() to set the search criteria before performing the search
autoApply
Boolean
Sets a filter value for the given filter
filter
values
Array
operator
String
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
callback
function
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
callback
function
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
callback
function
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
callback
function
function that receives the Filter object as argument and must return a scopes.svyPopupFilter.AbstractPopupFilter
Sets a callback method that is fired whenever a filter is removed
callback
function
Set the onSearchCommand function to override the search behavior. You can add custom conditions to the filter query object;
callback
function
Example
Sets the search text for the simple search
Shows the filter picker popup
target
RuntimeComponent
Boolean
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);
listComponent
RuntimeWebComponent.<customrenderedcomponents-customlist>
| RuntimeWebComponent.<customrenderedcomponents-customlist_abs>
[foundsetToFilter]
JSFoundSet
Example
titleText
String
dataProvider
String
filterType
String
any of the FILTER_TYPES enum values
Boolean
Applies all filters
Returns: Boolean
- true if records are loaded, false otherwise
Boolean
Clears all filters from the UI and fires the onFilterRemovedEvent
Executes the search
[searchText]
String
optional searchText to search for; if not provided here, call setSearchText() to set the search criteria before performing the search
[ 'Array' ].<scopes.svyPopupFilter.AbstractPopupFilter>
String
Returns the datasource to be filtered as the datasource of the NG Grid
scopes.svySearch.SimpleSearch
RuntimeComponent
Returns the element used to display the filters
Returns the Filter for the given dataprovider
dataprovider
String
Returns all filters of this ToolbarFilter
Array
JSFoundSet
Returns the foundset to be filtered as the foundset of the NG Grid
QBSelect
Applies all filters and returns the query for this toolbar
scopes.svySearch.SearchProvider
Returns the SearchProvider for the given column or dataprovider
columnOrDataProvider
CustomType.<aggrid-groupingtable.column>
| String
String
Returns the search text for the simple search
scopes.svySearch.SimpleSearch
Returns the SimpleSearch
[ '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
Boolean
Returns true if the toolbar has any dataprovider it can filter on
Called when the mouse is clicked on a list entry.
entry
object
index
Number
dataTarget
string
event
JSEvent
Removes the given filter
filter
Restores the filters' state
jsonState
[ 'Array' ].<{id: String, dataprovider: String, operator: String, params: Object, text: String, values: Array}>
Applies all filters and executes the search
[searchText]
String
optional searchText to search for; if not provided here, call setSearchText() to set the search criteria before performing the search
autoApply
Boolean
Sets a filter value for the given filter
filter
values
Array
operator
String
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
callback
function
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
callback
function
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
callback
function
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
callback
function
function that receives the Filter object as argument and must return a scopes.svyPopupFilter.AbstractPopupFilter
Sets a callback method that is fired whenever a filter is removed
callback
function
Set the onSearchCommand function to override the search behavior. You can add custom conditions to the filter query object;
callback
function
Example
Sets the search text for the simple search
Shows the filter picker popup
target
RuntimeComponent
Boolean
listComponent
RuntimeWebComponent.<customrenderedcomponents-customlist>
| RuntimeWebComponent.<customrenderedcomponents-customlist_abs>
tableComponent
RuntimeWebComponent.<aggrid-groupingtable>
| RuntimeWebComponent.<aggrid-groupingtable_abs>
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 match
any column with its filterType
property set to TEXT and the valuelist
will be offered as a lookup where the user can search for and select any number of values
any column with its filterType
property set to NUMBER will be offered as a number filter with a number of operators
any 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);
listComponent
RuntimeWebComponent.<customrenderedcomponents-customlist>
| RuntimeWebComponent.<customrenderedcomponents-customlist_abs>
tableOrFoundSet
RuntimeWebComponent.<aggrid-groupingtable>
| RuntimeWebComponent.<aggrid-groupingtable_abs>
Example
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);
listComponent
RuntimeWebComponent.<customrenderedcomponents-customlist>
| RuntimeWebComponent.<customrenderedcomponents-customlist_abs>
the component to render the filter
[foundsetToFilter]
JSFoundSet
optional foundset to filter; if not provided, the foundset of the form containing the listComponent element will be filtered
Example
Boolean
Returns true if the filter picker is sorted alphabetically
Since: v1.3.0
Sets global display date format to be used
displayFormat
String
Sort the the filter picker alphabetically. Default sort is based on column's position in grid.
Since: v1.3.0
sortAlphabetically
Boolean
Default false.
Use only visible columns of the grid when set to false
Since: v1.1.0
useNonVisibleColumns
Boolean
Default true.
Since: v1.1.0
formType
String
any of the FILTER_TYPES
operator
String
the default operator to be used. Use enum value from scopes.svyToolbarFilter.OPERATOR
Example
formType
String
any of the FILTER_TYPES
form
RuntimeForm.<AbstractPopupFilter>
| RuntimeForm.<AbstractLookup>
the form to set
Check filter
Date filter
INTEGER filter
Number filter
Select filter
Tokens filter
⇒
⇒ Boolean
Extends:
⇐
⇒
⇒ Boolean
⇒ Boolean
⇒ [ 'Array' ].<scopes.svyPopupFilter.AbstractPopupFilter>
⇒ String
⇒ scopes.svySearch.SimpleSearch
⇒ RuntimeComponent
⇒
⇒
⇒ JSFoundSet
⇒ QBSelect
⇒ scopes.svySearch.SearchProvider
⇒ String
⇒ scopes.svySearch.SimpleSearch
⇒ [ 'Array' ].<{id: String, dataprovider: String, operator: String, params: Object, text: String, values: Array}>
⇒ Boolean
⇒
⇒
⇒
⇒
⇒
⇒
⇒
⇒
: Boolean
:
Overrides:
Extends:
⇐
⇒
⇒ Boolean
⇒ Boolean
⇒ [ 'Array' ].<scopes.svyPopupFilter.AbstractPopupFilter>
⇒ String
⇒ scopes.svySearch.SimpleSearch
⇒ RuntimeComponent
⇒
⇒
⇒ JSFoundSet
⇒ QBSelect
⇒ scopes.svySearch.SearchProvider
⇒ String
⇒ scopes.svySearch.SimpleSearch
⇒ [ 'Array' ].<{id: String, dataprovider: String, operator: String, params: Object, text: String, values: Array}>
⇒ Boolean
⇒
⇒
⇒
⇒
⇒
⇒
⇒
⇒
: Boolean
Overrides:
Overrides:
Overrides: