0
votes

My requiremnt is to put some filters on smartTable form my controller.

In Event beforeRebindTable i am using the following code to put filter using this code which is working fine.

onBeforeRebindTable: function (oEvent) {
  var oBindingParams = oEvent.getParameter("bindingParams");
  statFilter = new sap.ui.model.Filter("Claim_TYPE", "EQ", "1234");
  oBindingParams.filters.push(statFilter);
} 

But the problem is when the user is clicling on table column on filter again, the filter i am adding in above code is not visible in the selection dialog. User may need to delete this filter, If its not visible in dialog they wont be able to delete it.

I am not able to establish the link why the dialog is not getting updated, or should i add this somewhere else. Thanks Sonal.

1

1 Answers

0
votes
    onBeforeRebindTable: function (oEvent) {
        var oSmartTable = oEvent.getSource();
        if (this._isOnInit == null) this._isOnInit = true;
        if (this._isOnInit) {
            oSmartTable.applyVariant(
                {
                    filter: {
                        filterItems: [{
                            columnKey: "YourSelectedColumn",
                            exclude: false,
                            operation: "EQ",
                            value1: "SomeEnteredValue",
                            value2: ""
                        }]
                    }
                }

            );
            this._isOnInit = false;
        }
    }