设置属性禁用复选框

时间:2017-10-26 03:46:06

标签: salesforce lightning salesforce-lightning aura.js

我希望在其中任何一个值出现时禁用该复选框,但它仅适用于一个值。

 <ui:inputCheckbox value="{!product.productSelection}" disabled="{! 
 or(product.orderLineStatus == 'Cancelled', product.orderLineStatus == 
 'Rejected',product.orderLineStatus == 'Scheduled to Ship')}"/>

1 个答案:

答案 0 :(得分:0)

  

如果产品是装饰品,那么您需要使用v.product.yourfield,否则就可以了   对于您的残疾情况,请参见以下代码

 <ui:inputCheckbox value="{!product.productSelection}" disabled="{! 
   or(or(product.orderLineStatus == 'Cancelled', product.orderLineStatus == 
     'Rejected'),product.orderLineStatus == 'Scheduled to Ship')}"/>
  

如果产品是属性,则

 <ui:inputCheckbox value="{!v.product.productSelection}" disabled="{! 
  or(or(v.product.orderLineStatus == 'Cancelled', v.product.orderLineStatus == 
  'Rejected'),v.product.orderLineStatus == 'Scheduled to Ship')}"/>