How to preserve some default filters, even if user clicks clear button

#1

Hi There,

I have a filter panel/component and defined it as follows:

Note my use of “hiddenFilter”:

ui module InventoryOptimization {
    component PurchaseOrderFilter {
        "component": "FilterForm",
        "id": "InventoryOptimization.PurchaseOrderFilter",
        "disabled" : true,
        "items": [
        {
                "id": "PurchaseOrderFilterSet",
                "component": "Fieldset",
                "title": "Purchase Order Details",
                "items": [
                    {
                        "id": "purchaseOrderId",
                        "component": "ControlGroup",
                        "label": "Purchase Order Id",
                        "field": {
                            "id": "purchaseOrderId",
                            "component": "field.SelectField",
                            "pagination": 20,
                            "placeholder": "purchaseOrderId",
                            "ignorePageRecord": true,
                            "name": "purchaseOrderId",
                            "sortField": "cells[0].str",
                            "valueField": "cells[0].str",
                            "displayField":"cells[0].str",
                            "caseSensitive": false,
                            "multiple": true,
                            "hiddenFilter": "promisedReceivedDate > date('2014-03-01') && promisedReceivedDate < date('2017-04-30') && scoreExists==true && exists(avgDelayRiskScore) && exists(maxDelayRiskScore)",
                            "data": {
                                "collection": "InventoryOptimization.FilterFieldPurchaseOrderId"
                            }
                        }
                    }
                ]
            }
        ]
    }
}

I notice that if the user clicks “clear” button on the filter widget, all filters are gone. Is there a way to preserve my hidden filter (prevent user from clearing it)?

Thanks

Paul

0 Likes

#2

Set saveBaseFilter config to true
You can also specify baseFilter using baseFilter config

0 Likes