Create a schema of the replacing section view model
- Go to the Configuration section and select a custom package to add the schema.
-
Click Add → Replacing view model on the section list toolbar.
-
Fill out the schema properties.
- Set Code to "ContractSectionV2".
- Set Title to "Page schema - "Contracts" section".
- Set Parent object to "ContractSectionV2".
-
Add localizable strings that contain filter names.
-
Add a localizable string that contains the name of the filter by owner.
- Click the
button in the context menu of the Localizable strings node.
-
Fill out the localizable string properties.
- Set Code to "OwnerFilterCaption".
- Set Value to "Owner".
- Click Add to add a localizable string.
- Click the
-
Add a localizable string that contains the name of the filter by period.
- Click the
button in the context menu of the Localizable strings node.
-
Fill out the localizable string properties.
- Set Code to "PeriodFilterCaption".
- Set Value to "Period".
- Click Add to add a localizable string.
- Click the
-
-
Implement the filtering behavior. To do this, implement the initFixedFiltersConfig() method in the methods property. In the method, create a configuration object with the array of PeriodFilter and OwnerFilter filters, assign the object link to the fixedFiltersConfig attribute of the view model.
View the source code of the replacing view model schema of the section below.
- Click Save on the Designer's toolbar.
The outcome of the example
To view the outcome of the example, refresh the Contracts section page.
As a result, Creatio will display the fixed filters block in the Contracts section. The block will let you filter contracts both by start date and owner.
