css - Sap-UI5: Adding a style class dynamically doesn't work
问题描述
I'm trying to add a css class dynamically using the controller.
Actually, I want the list item to have a green background when pressing the checkBox.
XML Code:
<CheckBox text="{i18n>ChoosePaymentMethods}" select="onListSelectionChange" useEntireWidth="true"
id="checkBox"/>
Controller Code:
onListSelectionChange: function (oEvent) {
var oCustomListItem = this.getView().byId("custom");
oCustomListItem.addStyleClass("lightBlueBackgroundListItem"); //doesn't work !!!
},
Style CSS:
.lightBlueBackgroundListItem {
background: green;
}
解决方案
推荐阅读
- r - hclustfun(distr) 中的错误:使用 heatmap.2 函数的外部函数调用 (arg 10) 消息中的 NA/NaN/Inf
- netsuite - 高级批准 - 供应商法案 - 不要获得下一个批准者
- javascript - 制作 mineSweeper JS/Jquery - 分配附近边缘的地雷数量不会正确读取
- security - 部署组 - 您无权注册目标。联系您的发布经理以授予权限
- python - 按所需输出形状进行平均池化
- puppeteer - 锁定 Windows 用户会话的 Puppeteer 行为
- node.js - 几秒钟后自动渲染页面
- powershell - 将 Windows 事件日志转换为文本或 CSV
- r - 在 fviz_pca_biplot 中为 var 和 ind 指定不同的点形状
- google-cloud-platform - 谷歌云平台负载均衡器客户端源IP/地理位置问题