Filters in Betty Blocks are very useful. You can use a filter to get a specific object out of a model or a collection or you can filter your grid so that you can see exactly the objects you want to see. In this article, all different types of filters and how to use them will be explained.
Every filter is made out of condition rows, with these conditions rows you can set up your filter. A filter can consist out of 1 condition row but it is also possible to make a filter with a lot of them. By grouping condition rows together you can make a filter even more efficient.
A predicate is a statement that will check your property. If a predicate results in true, the filter will show or fetch that property. If the statement is false, the filter will do nothing. Within Betty Blocks there are many different types of predicates that you can use.
How to filter data in a grid?
- Open the filters menu by clicking on the filters icon on the right side of the header.
- You can create a new filter by clicking on the New filter button.
- The filter menu will expand, you can create your filter in the expanded area.
- You can preview your filter by clicking on the Preview button.
- If you are happy with the results of your filter you can click on the Save button to save your filter.
- Now you can pick your filter on the left side of the filters menu.
- You can change the filter you selected by clicking on the Edit button.
- A default filter can be set by going into Builder Mode. Edit the grid you want to add a default filter to, by clicking on the gear icon on the left side of the header.
- You can choose the filter you want to set as default in the Default selected filter dropdown list.
- Click on the Save button to save the grid.
- Now the filter you selected will be used when you open the grid.
- If you want to get back to the normal view you can click on the All filter on the left side of the filters menu.