|
13 | 13 |
|
14 | 14 | function onDatatablesInitialized() { |
15 | 15 | var statusColumn = this.api().column(4); |
16 | | - var select = $('<select class="form-control input-sm"><option value="">ALL</option></select>') |
| 16 | + var select = $('<select id="dt-status-0" class="form-control input-sm"><option value="">ALL</option></select>') |
17 | 17 | .on('change', function () { |
18 | 18 | statusColumn.search($(this).val().trim()).draw(); |
19 | 19 | }); |
20 | 20 |
|
21 | | - $('#results_length').wrap('<div class="row"><div class="col-sm-4"></div></div>'); |
22 | | - $('#results_length').parent().parent() |
| 21 | + $('#dt-length-0').parent().parent() |
23 | 22 | .append( |
24 | | - $('<div class="col-sm-8"></div>') |
| 23 | + $('<div class="dt-search"></div>') |
25 | 24 | .append( |
26 | | - $('<label class="font-weight-normal">Status </label>').append(select) |
27 | | - ) |
| 25 | + $('<label for="dt-status-0" style="margin-right: 0.5em;">Status:</label>') |
| 26 | + ).append(select) |
28 | 27 | ); |
29 | 28 |
|
30 | 29 | // Add all possible status to the select |
|
78 | 77 | // this should be called each table we have a redrawn |
79 | 78 | this.setupResizers = function() { |
80 | 79 | var self = this; |
81 | | - table.find('.resizer').each(function() { |
82 | | - var resizerElement = $(this); |
| 80 | + table.find('th').each(function() { |
| 81 | + if ($(this).find('.resizer').length == 0) { |
| 82 | + // we only need one resizer per header cell |
| 83 | + $(this).append('<div class="resizer"></div>') |
| 84 | + } |
| 85 | + var resizerElement = $(this).find('.resizer'); |
83 | 86 | // the resizer must have the same size as the header cell to be detectable |
84 | 87 | resizerElement.height(resizerElement.parent().outerHeight()) |
85 | 88 | // we detach and reattach each event to prevent them from being triggered |
|
0 commit comments