Filter
Definition
A filter is used to define the appearance of the content of the table in the list view. It allows you to configure the list of columns to display by default, their order, the search conditions to apply, the sort order and for which type of view you want to use it (List or Related List).
Examples
Default filter
This filter is the default one for the list view of the Person
module.
Its label filter.all
will be replaced in the UI by its translation : All.
It displays by default the columns first_name
, last_name
, birthday
and city
.
As domain_id
and user_id
are null
, this filter is available in all domains, for all users.
As readonly
is true
, this filter cannot be deleted from the UI.
If no specific filters are defined for Related List, this filter will be used by default.
Custom filter for List View
This filter is a custom one available only in the domain with the id 1.
It is available for the user with the id 3, but as is_public
is true
, this filter is also visible by the others users.
Its name
is People called John. It will display like that in the UI, independently of the selected language.
It displays by default the columns first_name
, last_name
and birthday
.
It will only display records whose first_name
field contains John.
The results will be sorted by last_name
in ascending order.
Custom Filter for Related List
It could be useful to create specific filters for Related List to display different columns from those in the List View. To do this you just set related-list
for the type
of filter.
Properties
Attribute | Type | Description | Default |
module_id | int | Id of the module providing the filter | |
domain_id | int | Id of the domain for which the filter is available. If |
|
user_id | int | Id of the user for which the filter is available. If |
|
name | string | Filter's name. It can be translated if you add the translation in the module localization file. | |
type | string | If you use | |
columns | array | List of columns to display by default. | |
conditions | array | List of conditions to apply by default. The [ "search" => [ "first_name" => "John", "last_name" => "D" ] ] |
|
order | array | List of sort orders to use for each column, in the Notice: You must use the name of the field and not the name of the column in the database. Example: [ "first_name" => "asc", "birthday" => "desc" ] |
|
is_default | bool | Defines if the filter is use as the default one for the module. Normally there should only be one by default. By in case of several are defined as default, the first one found in the database will be used. |
|
is_public | bool | Defines if the filter is shared with other users. This property is used only if |
|
data | array | List of other options for the filter. By default, the only available option is |
|
Last updated