Search code examples
sapui5

SAPUI5: How to reset SmartTable P13N dialog?


I have a smart table in my UI5 application. When I visit one of the objects of my WorklistView, I will set a filter in my SmartTable's personalisation dialog (P13N). When I navigate back to my worklist and try to visit another entry I will see the filter that have set in the previous visit is there yet!

Smart Table P13N dialog

How can reset the P13N of a SmartTable each time that I visit the targeted view!

I need to call a function of the smart table in my onRouteMatched event handler. But I don't know what function or method can do this for me.


Solution

  • Thanks to the answer provided for my another question in this page, I finally reached to an answer for this question. I had to use applyVariant function in the onBindingChange function of the view.

    resetPersonalisation: function() {
            var oSmartTable = this.getView().byId("mySmartTableId");            
            oSmartTable.applyVariant({});
    }
    

    Then the personalisation model will be reset each time the specific route is matched.