Skip to content

Commit 93b19ce

Browse files
committed
Restore the test status dropdown for datatables 2
We have to query a new element id (dt-length-0 instead of results_length) since the old one is no longer available and select/input elements always have ID-s so they are more reliable across updates. We also follow the approach in datatables to provide ID for the added status select element and reuse the dt-search class for the new div element with the only exception that we need extra right margin to distance a colon appended "status" from the select element (only the input element will inherit the right marging from dt-search). Signed-off-by: Plamen Dimitrov <plamen.dimitrov@intra2net.com>
1 parent afbb1d3 commit 93b19ce

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

optional_plugins/html/avocado_result_html/templates/avocado_html.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@
1313

1414
function onDatatablesInitialized() {
1515
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>')
1717
.on('change', function () {
1818
statusColumn.search($(this).val().trim()).draw();
1919
});
2020

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()
2322
.append(
24-
$('<div class="col-sm-8"></div>')
23+
$('<div class="dt-search"></div>')
2524
.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)
2827
);
2928

3029
// Add all possible status to the select

0 commit comments

Comments
 (0)