on 2015 Mar 24 9:34 PM
hello everyone,
I'm trying to enhance cell colors depending on the content of the cell.
I'm consuming oData service from SAP backend.
this is the table:
var oTable = new sap.ui.table.Table({
id: "OverviewTable",
width : "100%",
rowHeight : 20,
title : "",
});
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({text : "Группа компаний""}),
template : new sap.ui.commons.TextView().bindProperty("text","SENDER_NUM"),
sortProperty : "SENDER_NUM",
filterProperty : "SENDER_NUM",
}));
oTable.bindRows("/DASHBOARDSet");
return oTable;
So, I'm passing values to table by .bindRows(); and field values: SENDER_NUM
The thing is that I'm trying to change cell color depending what value the SENDER_NUM has.
Where can I fetch the results?
As onInit, onBeforeRendering, and even after return.oTable there are no values yet in the table.
Where can I fetch the filled in value in the table?
Thank you.
Request clarification before answering.
the correct answer is mentioned in this post:
template: new sap.ui.commons.TextView().bindProperty("text", "amount", function(cellValue) {
// remove styles else it will overwrite
this.removeStyleClass('green');
this.removeStyleClass('yellow');
this.removeStyleClass('red');
// Set style Conditionally
if (cellValue >= 1500) {
this.addStyleClass('green');
} else if(cellValue < 1500 && cellValue > 1000) {
this.addStyleClass('yellow');
} else{
this.addStyleClass('red');
}
return cellValue;
}),
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
64 | |
8 | |
7 | |
6 | |
6 | |
5 | |
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.