Add fixed filter to custom section like "Owner" in Activities
Hi Community,
I am trying to add a fixed filter like "Owner" in Activities to a custom section. Below is the code I added for the same:
initFixedFiltersConfig: function() { var fixedFilterConfig = { entitySchema: this.entitySchema, filters: [ { name: "Owner", caption: this.get("Resources.Strings.OwnerFilterCaption"), addOwnerCaption: this.get("Resources.Strings.AddEmployeeFilterCaption"), hint: this.get("Resources.Strings.SelectEmployeeFilterHint"), columnName: "customSectionColumn", dataValueType: this.Terrasoft.DataValueType.LOOKUP, filter: BaseFiltersGenerateModule.OwnerFilter } ] }; this.set("FixedFilterConfig", fixedFilterConfig); }
I can see the filter getting added to the section. But the labels are not getting displayed. Below picture shows the default labels getting displayed.
I have added the captions OwnerFilterCaption("Employee"), AddEmployeeFilterCaption("Add Employee"), and SelectEmployeeFilterHint("Select Employee") to Localizable Strings for the section but when debugging the values are returned as undefined for this.get("Resources.Strings.OwnerFilterCaption").
Could anyone tell me what I am doing wrong and how to resolve the issue?
Like
Hi,
Here is an example on adding a custom fixed filter.
Case description:
You need to add a custom fixed filter by column Type to the Contact section.
Algorithm of realization:
- Create replacing client schema for your section.
- Create localizable strings which will contain captions of the filter and menu item.
- Create image which will contain image of the filter.
-
Source code of the "ContactSectionV2" :
define("ContactSectionV2", [], function() { return { entitySchemaName: "Contact", methods: { initFixedFiltersConfig: function () { var fixedFilterConfig = { entitySchema: "ContactType", filters: [ { name: "TypeFilter", columnName: "Type", referenceSchemaName: "ContactType", caption: this.get("Resources.Strings.ContactTypeFilterCaption"), dataValueType: this.Terrasoft.DataValueType.LOOKUP, appendCurrentContactMenuItem: false, addNewFilterCaption: this.get("Resources.Strings.SelectContactTypeCaption"), hint: this.get("Resources.Strings.SelectContactTypeCaption"), buttonImageConfig: this.get("Resources.Images.ContactTypeFilterImage") } ] }; this.set("FixedFilterConfig", fixedFilterConfig); } } }; });
The result:
Dmytro Vovchenko,
Thank you for your response. I compared with the code above and changed "addOwnerCaption" to "addNewFilterCaption" and it works now.