Styles of cells in sap.ui.table.Table can be changed by
changing style class names (whose are preliminary defined in css file)
in corresponding properties of table model (see oModelObject.styleClassName[j] below)
and then applying them to corresponding table cells (see aCells[j].addStyleClass below) in following way:
oTable = sap.ui.getCore().byId(sTableId);
if (oTable) {
aRows = oTable.getRows();
if (aRows && aRows.length > 0){
for (i = 0; i < aRows.length; i++) {
oModelObject = aRows[i].getBindingContext().getObject();
aCells = aRows[i].getCells();
if (oModelObject && aCells && aCells.length > 0) {
for (j = 0; j < aCells.length; j++) {
aCells[j].addStyleClass(oModelObject.styleClassName[j]);
}
}
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
36 | |
25 | |
17 | |
13 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 |