Bootstraps ICheck-Helper does not trigger on changed event

后端 未结 3 1885
慢半拍i
慢半拍i 2020-12-31 03:32

I have this Jquery code to be updating checkboxes base on whether a checkbox has been checked. However, This does not fire.

Code

         


        
相关标签:
3条回答
  • 2020-12-31 03:42

    Add the jQuery Events the trigger the onClick Event

    $('input[type="checkbox"], input[type="radio"]').on('ifChanged', function (e) {
         $(this).trigger("onclick", e);
    });
    
    0 讨论(0)
  • 2020-12-31 03:46

    Use ifChanged or ifChecked mentioned in the documentation

    $('input').on('ifChecked', function(event){
      alert(event.type + ' callback');
    });
    
    0 讨论(0)
  • 2020-12-31 04:00

    I just added this globally and it does the trick for me.

    $(".i-checks input").on('ifChanged', function (e) {
        $(this).trigger("change", e);
    });
    
    0 讨论(0)
提交回复
热议问题