1

Knockout検証ライブラリでKnockout.Comboboxを使用しようとしています。

https://github.com/AndersMalmgren/Knockout.Combobox

http://jsfiddle.net/Zc9Aj/

this.errors = ko.validation.group(this);
this.errors.showAllMessages();

上記は機能しません。検証ライブラリはコンボボックスバインディングを検証する方法を理解していないと思いますが、これら2つのライブラリをどのようにリンクしますか?

4

1 に答える 1

1

Knockout Validation は、すぐに使用できる Value バインディングのみをサポートします。コンボボックスをサポートするために、このようなことを行うことができます

http://jsfiddle.net/AWHhr/78/

ko.bindingHandlers.comboboxValue = { 
    init: ko.bindingHandlers.validationCore.init
};
于 2012-12-30T19:47:16.120 に答える