16 lines
No EOL
444 B
JavaScript
16 lines
No EOL
444 B
JavaScript
(function($) {
|
|
$.fn.selectAll = function() {
|
|
var $table = $(this);
|
|
$("input[data-select-all]", this).click(function(e) {
|
|
var $checkbox = $(this);
|
|
|
|
$table
|
|
.find( "input[data-selected-by=" + $checkbox.data("select-all") + "]" )
|
|
.prop( "checked", $checkbox.is(":checked") )
|
|
})
|
|
}
|
|
})(jQuery);
|
|
|
|
jQuery(function($) {
|
|
$("table.select-all").selectAll();
|
|
}); |