Sapui5 在模型数据更改时更新CSS

Sapui5 在模型数据更改时更新CSS,sapui5,Sapui5,我们可以根据模型数据更新CSS吗 在这里,我试图在cursor:pointer和光标:默认 <core:Icon id="Submit Button" size="2rem" src="sap-icon://appointment" press="onAppointmentIconClick" enabled="{ path: 'data>/isFree', formatter: '.buttonFormat' }"> </core:I

我们可以根据模型数据更新CSS吗

在这里,我试图在
cursor:pointer
光标:默认

<core:Icon id="Submit Button"
  size="2rem"
  src="sap-icon://appointment"
  press="onAppointmentIconClick"
  enabled="{
    path: 'data>/isFree',
    formatter: '.buttonFormat'
  }">
</core:Icon>

您的问题“我们可以在数据绑定上更新CSS吗”的答案是肯定的,您可以使用customData和formatters以及WriteDom属性true和custom样式,如

.sapuicon[data yourkey=“xxx”]{cursor:default!important;}

在这里你可以找到更多的细节

但另一方面,这是图标控件本身的一个bug,在夜间(1.30)版本中已修复

您不能直接绑定到css类,但可以在press处理程序上调用myIcon.addStyleClass('bla'),并对其进行相应更改。

的可能重复项