Integrieren Sie das iCheck-Plugin in die Knockout-Js

Kann mir jemand helfen, richtig zu integriereniCheck Plugin mitknockout? weil ich versucht habe, das Plugin mit einer benutzerdefinierten Bindung für mein Optionsfeld zu initialisieren, aber es den Wert des Ansichtsmodells nicht aktualisiert.

HTML
<div data-bind="foreach: InstituteContactNumber">
   <div class="controls multiple-controllers">
       <input type="hidden" data-bind="value: CNoId" />
       <input class="tb-contact-no" type="text" data-bind="value: CNo" />
       &nbsp;
       **<input type="radio" name="radio-cno" 
                     data-bind="RadioButton: { checked: IsPrimary }" />**
         <i class="fa fa-trash-o ctr-btn" style="color: red;" 
               data-bind="click: $parent.RemoveContactNo, visible: $index() > 0"></i>           
   </div>
</div>
Knockout-Bindung
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.
    }
};

Antworten auf die Frage(3)

Ihre Antwort auf die Frage