/* TYPE YOUR JAVA SCRIPT HERE */
$(function() {
    $('#selectAll').on('click', function() {
        var that = $(this);
        var stat = that.attr('data-checked');
        if (stat == 1) {
            $('.table .checkbox-custom input:checkbox').prop('checked', false);
            that.html('<i class="fa  fa-check-square-o"></i>全选');
            that.attr('data-checked', 0);
        } else {
            $('.table .checkbox-custom input:checkbox').prop('checked', true);
            that.html('<i class="fa fa-ban"></i>取消');
            that.attr('data-checked', 1);
        }
    });
    $('#selectback').on('click', function() {
        var that = $(this);
        var stat = that.attr('data-checked');
        if (stat == 1) {
            $('.table .checkbox-custom input:checkbox').prop('checked', false);
            that.html('<i class="fa fa-check-square"></i>反选');
            that.attr('data-checked', 0);
        } else {
            $('.table .checkbox-custom input:checkbox').each(function() {
                this.checked = !this.checked;
            });
            that.html('<i class="fa fa-ban"></i>取消');
            that.attr('data-checked', 1);
        }
    })

});
