on 2020 Nov 05 2:47 PM
Dear Experts,
I'm using sap.ui.table for table selection.
I was trying to populate rows for selected indexes.
selectTableList: function (tableId, selectionList, selectionModel) {
var selectData = selectionModel.getData();
var selectionListNames = selectionList.split(",");
for (var i = 0; i < selectionListNames.length; i++) {
for (var j = 0; j < selectData.length; j++) {
if (selectData[j]["Name"].trim() === selectionListNames[i].trim()) {
var oTable = this.getView().byId(tableId);
oTable.addSelectionInterval(0, j);
}
}
}
},
above code selecting the from index 0 to till J, but i need only few rows to be selected for that i have used below code but it displays data but nothing is selected.
selectTableList: function (tableId, selectionList, selectionModel) {
var selectData = selectionModel.getData();
var selectionListNames = selectionList.split(",");
for (var i = 0; i < selectionListNames.length; i++) {
for (var j = 0; j < selectData.length; j++) {
if (selectData[j]["Name"].trim() === selectionListNames[i].trim()) {
var oTable = this.getView().byId(tableId);
oTable.addRow(j);
}
}
}
},
User | Count |
---|---|
70 | |
9 | |
8 | |
7 | |
7 | |
6 | |
5 | |
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.