|
1 |
| -/*! Checkboxes 1.1.0-dev |
| 1 | +/*! Checkboxes 1.1.0-alpha.1 |
2 | 2 | * Copyright (c) Gyrocode (www.gyrocode.com)
|
3 | 3 | * License: MIT License
|
4 | 4 | */
|
5 | 5 |
|
6 | 6 | /**
|
7 | 7 | * @summary Checkboxes
|
8 | 8 | * @description Checkboxes extension for jQuery DataTables
|
9 |
| - * @version 1.1.0-dev |
| 9 | + * @version 1.1.0-alpha.1 |
10 | 10 | * @file dataTables.checkboxes.js
|
11 | 11 | * @author Gyrocode (http://www.gyrocode.com/projects/jquery-datatables-checkboxes/)
|
12 | 12 | * @contact http://www.gyrocode.com/contacts
|
@@ -230,6 +230,28 @@ Checkboxes.prototype = {
|
230 | 230 | $tableContainer.on('click', 'thead th.dt-checkboxes-select-all', function(e) {
|
231 | 231 | $('input[type="checkbox"]', this).trigger('click');
|
232 | 232 | });
|
| 233 | + |
| 234 | + // Handle click on "Select all" control in floating fixed header |
| 235 | + $(document).on('click', '.fixedHeader-floating thead th.dt-checkboxes-select-all input[type="checkbox"]', function(e){ |
| 236 | + // If FixedHeader is enabled in this instance |
| 237 | + if(ctx._fixedHeader){ |
| 238 | + // If header is floating in this instance |
| 239 | + if(ctx._fixedHeader.dom['header'].floating){ |
| 240 | + self.onClickSelectAll(e, this); |
| 241 | + } |
| 242 | + } |
| 243 | + }); |
| 244 | + |
| 245 | + // Handle click on heading containing "Select all" control in floating fixed header |
| 246 | + $(document).on('click', '.fixedHeader-floating thead th.dt-checkboxes-select-all', function(e) { |
| 247 | + // If FixedHeader is enabled in this instance |
| 248 | + if(ctx._fixedHeader){ |
| 249 | + // If header is floating in this instance |
| 250 | + if(ctx._fixedHeader.dom['header'].floating){ |
| 251 | + $('input[type="checkbox"]', this).trigger('click'); |
| 252 | + } |
| 253 | + } |
| 254 | + }); |
233 | 255 | }
|
234 | 256 | },
|
235 | 257 |
|
@@ -554,6 +576,14 @@ Checkboxes.prototype = {
|
554 | 576 | var $checkboxesChecked = dt.$(cells.nodes()).find('.dt-checkboxes:checked');
|
555 | 577 | var $checkboxesSelectAll = $('.dt-checkboxes-select-all[data-col="' + colIdx + '"] input[type="checkbox"]', $tableContainer);
|
556 | 578 |
|
| 579 | + // If FixedHeader is enabled in this instance |
| 580 | + if(ctx._fixedHeader){ |
| 581 | + // If header is floating in this instance |
| 582 | + if(ctx._fixedHeader.dom['header'].floating){ |
| 583 | + $checkboxesSelectAll = $('.fixedHeader-floating .dt-checkboxes-select-all[data-col="' + colIdx + '"] input[type="checkbox"]'); |
| 584 | + } |
| 585 | + } |
| 586 | + |
557 | 587 | // If none of the checkboxes are checked
|
558 | 588 | if ($checkboxesChecked.length === 0) {
|
559 | 589 | $checkboxesSelectAll.prop({
|
|
0 commit comments