I have a table in SAPUI5, which works fine, displaying 5 cells of info.
However, how do I apply logic to this? For example, I sometimes need the 2nd cell to be a sap.m.RatingIndicator
as opposed to sap.m.Text
.
Is there a way to provide logic or must the cells always be hard-coded?
oTable.bindItems("/", new ColumnListItem({
cells: [
new HTML({ // sap/ui/core/HTML
content: "<p style='margin:0'>{path: 'Sequence', type: 'sap.ui.model.odata.type.String', constraints: {isDigitSequence: true}}. {QuestionDesc} - <strong>{CompetencyDesc}</strong></p>"
}),
new Text({ // sap/m/Text
text: "{AnswerLabel} ({AnswerScore})",
visible: true
}),
new Image({ // sap/m/Image
src: "{SmileyUrl}",
width: "2em"
}),
// ...
]
}));