Интегрировать плагин iCheck с нокаутом js
Может ли кто-нибудь помочь мне правильно интегрироватьiCheck
плагин сknockout
? потому что я пытался использовать пользовательские привязки для инициализации плагина для моей кнопки радио, но это 'не обновляет значение модели представления.
****
привязка нокаутаko.bindingHandlers.RadioButton = {
init: function (element, valueAccessor) {
//initialize icheck to the element
$(element).iCheck({
radioClass: 'iradio_square-blue'
});
$(element).on('ifChecked', function () {
var observable = valueAccessor();
// trying to change the observable value
observable.checked = true;
});
},
update: function (element, valueAccessor) {
var observable = valueAccessor();
//initially fires but it not fired when I tried to change the observable value
//I hope that means the value has not been changed
//anyway I have checked the model on submit, it also did not contain the values.
}
};