通过遍历一个表(不是本机表),我能够获得所需的每一行的每个单元格值,现在我想为其中的某些单元格元素添加某种样式(如果该值确实与另一个批评)。我该怎么办?
我最初的想法是,使用getItems().. chose列和all.Ide来获取特定单元格的想法,而不是使用addStyleClass或style.color将特定样式添加到特定的单元格ID中。
但是它没有成功,所以现在我在这里。
该怎么办?在控制面板中有没有一种添加样式的捷径。
还应该通过获取IDE并尝试将其添加到Style中来添加错误:Uncaught TypeError:无法读取未定义的属性'addStyleClass'
答案 0 :(得分:-1)
我通过以下方式解决了类似的问题:
sap.ui.define([], function() {
var ListItemFormatter = {
listItemType: function(bCondition) {
if (bCondition) {
this.removeStyleClass("inactiveListItem");
}
this.addStyleClass("inactiveListItem");
},
...
};
return ListItemFormatter;
}, true);
jQuery.sap.require("myproject.formatter.ListItemFormatter");
<ColumnListItem type="{ path: 'AlreadyParticipated', formatter: 'myproject.formatter.ListItemFormatter.listItemType' }">
我希望这会有所帮助!