on 11-02-2015 5:19 PM
Hello,
i got at question concerning the sap m.table.
I have an application with table with with colummns.
A, B, C, D ,E.
The table is sorted by A.
I have an f4 value help wich allows the user to change the value of column A.
The colummn contains
HS02
HS06
HS08
HS10
After changing HS02 to HS09
HS09
HS06
HS08
HS10
The table is not sorted by column a anymore.
Is there a way to refresh the sorting /actualize the sorting of the table after the change?
If so how?
Best regards.
Dirk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dirk,
Wherever you have placed the value change logic (make sure your model is also updated with the change value), next to that try something like this -
var oSorter = new sap.ui.model.Sorter("A"); //A is your column name
var oTable = this.getView().byId("oTable"); //Get Hold of table control, if it is not MVC use sap.ui.getCore().byId("oTable")
var oBinding = oTable.getBinding("items");
oBinding.sort(oSorter);
Regards,
Sai Vellanki.
Dirk,
I have created a JSBin for you, check it here: JS Bin - Collaborative JavaScript Debugging
Try to change the product column value and hit enter, it will automatically sort. I have used JSON model, but the sort logic remains same for XML model as well.
Regards,
Sai Vellanki.
sort method of the binding should do i trick. model is json or odata?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.