drgullin / icheck

Highly customizable checkboxes and radio buttons (jQuery & Zepto)
http://fronteed.com/iCheck
7.38k stars 1.62k forks source link

Cool plugin ! But is it possible to Integrate iCheck with knockout? I tried to do so and didn't get the expected results ! #120

Closed chamweer closed 10 years ago

chamweer commented 10 years ago

binding

ko.bindingHandlers.RadioButton = { init: function (element, valueAccessor) { //initialize plugin $(element).iCheck({ radioClass: 'iradio_square-blue' });

    $(element).on('ifChecked', function () {
        //try to change the observable value
        var observable = valueAccessor();
        observable.checked = true;          

    });
},
update: function (element, valueAccessor) {
    var observable = valueAccessor();
    debugger;
    //initially fired but on change of value it does not fired
}

};

drgullin commented 10 years ago

Duplicate of #4