【发布时间】:2012-05-05 01:08:53
【问题描述】:
我正在使用 primefaces 日历。日历放在 primefaces 的数据表上。
我需要使用 jquery 禁用日历。
<p:column width="170">
<p:calendar id="vendorStartDate" value="#{articlePromo.fechaInicio}"
pattern="dd/MM/yyyy" mode="popup" showOn="button">
</p:calendar>
</p:column>
以下没有禁用日历:
$(#vendorStartDate).attr('disabled','disabled');document.getElementById("vendorStartDate").disabled = true;
在查看源代码时,我可以确定它实际上是一个输入文本和一个按钮。输入文本的 id = vendorStartDate_input。但是按钮没有获得 id。
日历的启用/禁用取决于其他列的值。因此,在该列的 onChange 事件上,我需要禁用日历组件 - 输入文本和按钮。
我可以使用以下方法禁用输入文本:
document.getElementById("vendorStartDate_input").disabled = true;
如何禁用按钮?
谢谢, 希哈
【问题讨论】:
标签: javascript jquery jsf-2 primefaces