我有这样的代码
var databaseViewModel = new function () {
var self = this;
self.databaseList = ko.observable("");
self.id = ko.observable("");
self.databaseSelected = ko.observable("");
self.description = ko.observable("description");
self.openList = function () {
alert("openList");
};
}
html:</p>
<div data-bind="foreach: databaseList">
<li><a href="javascript:void(0)" data-bind="click:'databaseViewModel.openList(this)', attr: { title: DataBaseName }">
<span class="pic1"></span><span data-bind="text:DataBaseName"></span></a></li>
<div data-bind="attr: { 'data-something': DataBaseName }">
...</div>
</div>
我想点击链接DataBaseName时调用openlist,如何修改代码?</p>