首先,我想就愚蠢的问题道歉。我没有找到一个很好的资源,我可以搜索这些问题。请帮忙。 我正在定制一个日期定义如下的页面。我无法出于其他原因添加ID,因此必须使用元素名称来调用更改事件。
RelativeSource
当我使用这样的名字时
<ListBox.ItemTemplate>
<DataTemplate>
<Button Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListBox}},
Path=DataContext.MyCommand}" />
它不会触发事件。为什么?我怎样才能使它工作?在此先感谢您的帮助!
答案 0 :(得分:2)
将您的代码更新为
$("input[name='[04]datestart]'").change(function()
删除$
旁边的额外j这是一个工作的掠夺者 - http://plnkr.co/edit/mKPDwgCLTwdxD6lFaX4j?p=preview