操作子元素的属性 [英] manipulate a property of a child element

查看:50
本文介绍了操作子元素的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下带有双击事件的行元素.

I have the following row element with a double click event atached to it.

<tr ondblclick="onLabelDoubleClicked(this)">
   <td><label id="labelId" >My Label</label></td>
   <td><input type="text" id="myInput" data-bind="kendoDropDownList: { data: source, value: myValue, enable: true }" /></td>
</tr>

双击,我需要在输入元素中设置kendoDropDownListenable属性,以切换是/否.

On double click I need to set the enable property of kendoDropDownList in input element to toggle true/ false.

javascript:

javascript:

onLabelDoubleClicked = function (event) {

    }

我搜索了event属性,但是找不到任何有用的东西来获取和操作enable property.任何有关工作示例的帮助将不胜感激.谢谢!

I searched through the event properties but could not find anything useful to get the enable property and manipulate it. Any help with working example will be greatly appreciated. Thank You!

推荐答案

如果您可以使用jQuery(并且标记集表示您在使用),为什么不只使用jQuery(和Kendo)方法呢?

If you can use jQuery (and tag sets implies you're), why not just use jQuery (and Kendo) methods?

$('tr').dblclick(function() {
  var $kd = $(this).find('input').data("kendoDropDownList");
  $kd.enable( $kd.element.is(':disabled') );
});

这篇关于操作子元素的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆