on ‎2023 Jul 03 2:41 PM
Hey everyone, hope you guys can help me with this.
I have been trying to extract the values from the selected values on a table. I used the following the table with MultiSelectionPlugin and I have not been able to get the selected VALUES, only the indices which I can't compare to the original model data because they change if the table is filtered.
Is there any way to get an array of objects of the selected items only?
From what I've read on other answers getSelectedItems() and getSelectedContexts() would work great but they are to available for me FSR. Also something like getRows() that gives the full array of items already filtered would let me retrieve the data with just the indices gotten from .getSelectedIndices()
I'm on UI5 1.96.22
Thanks in advance
Request clarification before answering.
You can use getSelectedItems().
Just like:
var table = this.getView().byId("myTable");
var selectedItems = table.getSelectedItems();
var selectedData = selectedItems .map(function(item) {
return item.getBindingContext().getObject();
});
Does this work for you?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.