繁体   English   中英

使用Jquery禁用Datapicker日历图标?

[英]Disable Datapicker Calendar icon using Jquery?

我有一个包含一组数据的表。 现在,在我的表格中,我对启用或禁用行的每一行都有一个复选框。 当我单击复选框时,该特定行应被禁用。 问题是我可以禁用日期选择器字段,但是日历图标仍然保持启用状态。

以下是我一直在使用的代码:

对于日期选择器文本框(很好):

$(this).closest('tr').find('.animalBroughtDate').prop('disabled', true);

对于日历图标(不起作用):

$(this).closest('tr').find('.ui-datepicker-trigger').hide();

HTML:

<input id="animalBroughtDateId" class="animalBroughtDate dtp hasDatepicker" style="width: 100px;" type="text">

<img title="Ok" alt="Ok" src="/../..datePicker.png" class="ui-datepicker-trigger">

请指导。

使用内置的UI datepicker disable命令。

$(this).closest('tr').find('.animalBroughtDate').datepicker("disable");

如果您只想启用:

 $(this).closest('tr').find('.animalBroughtDate').datepicker("enable");

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM