Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Create helper for selecting rows in grid
- */
- $('.grinder-toolbar').each(function () {
- $(this).prepend(
- $('<span>', {'class':'grinder-toolbar-action grinder-row-checker'}).append(
- $('<button>', {'class':'button'}).append(
- $('<input>', {'type':'checkbox'})
- .css({'margin':'0px','padding':'0px'})
- .change(function () {
- var $grid = $(this).closest('.grid');
- var $gridBoxes = $grid.find('input.grinder-row-check[type=checkbox]');
- var $gridCheckers = $grid.find('.grinder-toolbar .grinder-row-checker input[type=checkbox]');
- if (this.checked == true) {
- $gridBoxes.attr('checked', true);
- $gridCheckers.attr('checked', true);
- } else {
- $gridBoxes.attr('checked', false);
- $gridCheckers.attr('checked', false);
- }
- })
- )
- )
- );
- });
Advertisement
Add Comment
Please, Sign In to add comment