在更改事件中从kendo下拉列表中获取数据属性

时间:2017-10-20 08:46:17

标签: kendo-dropdown

我为kendo下拉列表设置了数据属性,如下所示。

  

.HtmlAttributes(new {style =“width:100%”,required =“required”,data_id = item.Id})

我试过这个

  

$(本)。数据( “ID”);

但它给出了“未定义”。我如何在更改事件中获取此数据属性值

1 个答案:

答案 0 :(得分:1)

我使用如下,它适用于我

this.element.attr('data-id');