Hi All,
We are trying to change the color for selected(single/multiple) rows in table we can able to select the rows and rows also getting highlighted but while we are trying to scroll down that selected color getting shifted to next row.
And we are not able to get the all the rows in table through getRows() method please advice on this also.
//Table for Production Order Broadcast Display
var oTablePOB = new sap.ui.table.Table("maintable",{
selectionMode: sap.ui.table.SelectionMode.multi,
//navigationMode: sap.ui.table.NavigationMode.Scrollbar,
visibleRowCount:100,
width:"100%",
editable:false,
rowSelectionChange: function() {
this.$().find('.selectedRows').each(function() {
$(this).removeClass('selectedRows');
});
var selectedIndices = oTablePOB.getSelectedIndices();
// var selectedIndices = oTablePOB.getParameter('rowIndices');
if (selectedIndices.length >= 1) {
var rows = oTablePOB.getRows();
selectedIndices.forEach(function(idx) {
alert(rows[idx]);
rows[idx].$().addClass('selectedRows');
});
this.$().find('.sapUiTableRowHdrScr').find('DIV').each(function(i) {
if (selectedIndices.indexOf(i) !== -1) {
$(this).addClass('selectedRows');
}
}); }}
}).addStyleClass("textfont");
Thanks & Regards,
Sivakumar Palani.