Event . on('click', does not work on input containing data-Md-icheck

Asked

Viewed 281 times

1

Hello, in my role has the event .onClick that should activate when marking the checkbox, but when I use the data-md-icheck it is ignored by the function.

<input type="checkbox" data-md-icheck class="ts_checkbox"/>

Event:

$(document).on('click', 'input[type="checkbox"]', function () { 
    $this.click = $(this);
    $this.get();
});
  • Good people, I found the documentation and the solution. http://icheck.fronteed.com/#callbacks

  • Post as answer to your question and then mark it as right.

2 answers

0


-1

For me the Event ifChanged Works fine.

$(document).ready(function(){
       var callbacks_list = $('.demo-callbacks ul');
            $('.demo-list input').on('ifCreated ifClicked ifChanged ifChecked ifUnchecked ifDisabled ifEnabled ifDestroyed check', function(event){
                $('#'+this.id+':checkbox').attr('checked', function(idx, oldAttr) {
                   return !oldAttr;
                }); //this manipulates checked state of checkbox
            }).iCheck({
              checkboxClass: 'icheckbox_square-blue',
              radioClass: 'iradio_square-blue',
              increaseArea: '20%'
            });
          });
  • This site is in Portuguese, therefore it is recommended that your answer is also.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.