【发布时间】:2012-06-09 03:17:00
【问题描述】:
我的页面上有此链接 - 用于按首字母查找条目。我想将锚标记的文本传递到 data-bind 属性内的敲除单击事件中。这可能吗?
<a href="#" data-bind="click: $parent.getManageableEntries()><%= Convert.ToChar(i + 65)%></a></li>
// here's my javascript method in my knockout view model
function ManageEntriesViewModel() {
var self = this;
this.getManageableEntries = function(firstLetter) {
// i want to pass in the text of the <a> tag as the 'firstLetter' variable
}
}
【问题讨论】:
标签: data-binding click knockout.js