|
1 |
| -/*! Checkboxes 1.2.1 |
| 1 | +/*! Checkboxes 1.2.2 |
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.2.1 |
| 9 | + * @version 1.2.2 |
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
|
@@ -537,12 +537,20 @@ Checkboxes.prototype = {
|
537 | 537 |
|
538 | 538 | var cellSelector;
|
539 | 539 |
|
540 |
| - // Get cell and column index |
541 |
| - var cellIdx = this.getCellIndex($(ctrl).closest('td')); |
542 |
| - var colIdx = cellIdx.column; |
543 |
| - |
544 | 540 | // Get cell
|
545 |
| - var cell = dt.cell(cellIdx); |
| 541 | + var $cell = $(ctrl).closest('td'); |
| 542 | + |
| 543 | + // If cell is in a fixed column using FixedColumns extension |
| 544 | + if($cell.parents('.DTFC_Cloned').length){ |
| 545 | + cellSelector = dt.fixedColumns().cellIndex($cell); |
| 546 | + |
| 547 | + } else { |
| 548 | + cellSelector = $cell; |
| 549 | + } |
| 550 | + |
| 551 | + var cell = dt.cell(cellSelector); |
| 552 | + var cellIdx = cell.index(); |
| 553 | + var colIdx = cellIdx.column; |
546 | 554 |
|
547 | 555 | // If row selection is not enabled
|
548 | 556 | // NOTE: if row selection is enabled, checkbox selection/deselection
|
@@ -620,9 +628,17 @@ Checkboxes.prototype = {
|
620 | 628 | var dt = self.s.dt;
|
621 | 629 | var ctx = self.s.ctx;
|
622 | 630 |
|
623 |
| - // Get cell and column index |
624 |
| - var cellIdx = this.getCellIndex($(ctrl).closest('th')); |
625 |
| - var colIdx = cellIdx.column; |
| 631 | + // Calculate column index |
| 632 | + var colIdx = null; |
| 633 | + var $th = $(ctrl).closest('th'); |
| 634 | + |
| 635 | + // If column is fixed using FixedColumns extension |
| 636 | + if($th.parents('.DTFC_Cloned').length){ |
| 637 | + var cellIdx = dt.fixedColumns().cellIndex($th); |
| 638 | + colIdx = cellIdx.column; |
| 639 | + } else { |
| 640 | + colIdx = dt.column($th).index(); |
| 641 | + } |
626 | 642 |
|
627 | 643 | dt.column(colIdx, {
|
628 | 644 | page: (
|
@@ -987,7 +1003,7 @@ Api.registerPlural( 'columns().checkboxes.selected()', 'column().checkboxes.sele
|
987 | 1003 | * @name Checkboxes.version
|
988 | 1004 | * @static
|
989 | 1005 | */
|
990 |
| -Checkboxes.version = '1.2.1'; |
| 1006 | +Checkboxes.version = '1.2.2'; |
991 | 1007 |
|
992 | 1008 |
|
993 | 1009 |
|
|
0 commit comments