on 2021 Mar 18 1:40 PM
I have created a table using sap.ui.table. I have created sorting and filtering options for the column. But there is no button/option for unsorting a sorted column either ascending or descending.
Is there any property which allows to unsort a column in sap.ui.table as I don't want to create a function for the same.
Request clarification before answering.
Hi Rakesh!
It's an interesting idea and I've heard it asked before. Sorry to say, though, that "unsorting" makes no sense. You simply have to sort it in another way to remove the current sorting.
For instance if you get a deck of cards, and you sort them by color and value. When finished, how would you then define unsorting them? Shuffle them is one option, but do you want to do that to the data in your table?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Definitely would agree to the idea you have put forward here. To put my question in a better way, the records appear sorted according to time of creation, initially when i load the view, that is latest created record coming first and thereafter the rest. After sorting the records according to any column, I didn't find any option to sort it like the initial sorting. Is there any way I can re-introduce that initial sorting?
Hi Rakesh,
Unfortunately there is no built-in way. I would think the best way is to actually sort it from the beginning, setting the sort on that "time of creation" column right from the start. Then it would be clear and it might be easier for the user to understand that they can change the sorting between different fields, and how to get back to the first layout.
Other options, if you REALLY need this, could be to consider duplicating the data and storing it in a separate model, that you then can copy into the "real" model again. You would need to write separate code to perform that action. But that would also require you making changes to both tables, if this is a table where changes are made. Or you could simply reload it all from whichever backend you use.
Hi Rakesh,
please get the Column of the table and set the Property sorted to false.
Best Regards
Thorsten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
11 | |
9 | |
8 | |
7 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.