Reset sorting in TableEnhanced
-
Jan SchroederHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the online course Advanced (320)1 year ago #40111
Hello Simplifier experts,
In my application I use a TableEnhanced Widget where the elements are bound via the output of an SSBO.
By default, TableEnhanced allows you to sort a column by clicking on the column name. That’s fine. But I don’t want the table to “remember” the last sort.
Is there a way to reset the sorting of the entire table, i.e. all columns, using a script?
Best regards
Jan Schroeder- This topic was modified 1 year ago by Jan Schroeder.
Andreas DallnerHas successfully completed the online course IntroductionHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the online course Advanced (320)Has successfully completed the Intermediate CertificationHas successfully completed the Advanced Certification1 year ago #40130::Hi Jan,
if you also enable the sort button, this can easily be done by clicking the reset button.
If you want it o achieve it automatically it is more stable to change the view settings binding data. Else view settings dialog binding might or will overwrite your changes with next rendering again.
The other (maybe simpler) way is to get the intial settings via oData = this.getView().byId(“TABLE SID”).getTablePersonalizationSettings() on start and reload it each time you want to reset the view: this.getView().byId(“TABLE SID”).setTablePersonalizationSettings(oData).
-> For that you can also use the properties getTablePersonalizationSettings and setTablePersonalizationSettings in UI Action or BO Mapping.
Kind regards Andreas
Jan SchroederHas successfully completed the online course Intermediate (200)Has successfully completed the online course Advanced (300)Has successfully completed the online course Basics (100)Has successfully completed the online course Advanced (310)Has successfully completed the online course Advanced (320)1 year ago #40128::Maybe I found a solution on my own.
I’m happy about suggestions if this can be solved in a simpler/more generic way.sap.ui.getCore().byId(“Screen_Name–TableEnhanced_Name”).getBinding(“items”).sort(null)
Afterwards I call the method setSortIndicator(null) for all columns.
- This reply was modified 1 year ago by Jan Schroeder.
You must be logged in to reply to this topic.