我有一个表单中的下拉列表,其值需要在单击保存按钮时传递给网格。我正在使用剑道 ui 和淘汰赛 js
我将它绑定在视图模型中:
JS
this.blahList = ko.observableArray(["1", "1", "p3","c3ai"]);
this.blah = ko.observable();
this is my add function:
this.addBorrower = function() {
this.borrowers.push(new Borrower({ name: this.newName(), address: this.newAddress() , blah: this.newBlah()}));
};
HTML
<li>
blah :
<input data-bind="kendoDropDownList: { data: blahList, value: newBlah}" />
</li>
它显示一个错误
错误
Uncaught Error: Unable to parse bindings.
Message: ReferenceError: newBlah is not defined;
Bindings value: kendoDropDownList: { data: blahList, value: newBlah}
Uncaught TypeError: Object #<AppViewModel> has no method 'newBlah'
有人能帮我吗?