Article

Add a custom FixedFilter

Case description:

You need to add a custom fixed filter by column Type to the Contact section.

Algorithm of realization:

  1. Create replacing client schema for your section.
  2. Create localizable strings which will contain captions of the filter and menu item.
  3. Create image which will contain image of the filter.
  4. Source code of the "ContactSectionV2" :

define("ContactSectionV2", [], function() {
    return {
        entitySchemaName: "Contact",
        methods: {
            initFixedFiltersConfig: function () {
                var fixedFilterConfig = {
                    entitySchema: "ContactType",
                    filters: [
                        {
                            name: "TypeFilter",
                            columnName: "Type",
                            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 would be:

Like 0

Like

Share

0 comments
Show all comments