diff --git a/horizon/static/horizon/js/horizon.tables.js b/horizon/static/horizon/js/horizon.tables.js index b5a1f60db..9e1304fc0 100644 --- a/horizon/static/horizon/js/horizon.tables.js +++ b/horizon/static/horizon/js/horizon.tables.js @@ -115,19 +115,6 @@ horizon.datatables = { $(this).find(".table_actions button.btn-danger").addClass("disabled"); } }); - - $("div.table_wrapper, div.modal_wrapper").on("click", ':checkbox', function (evt) { - var $form = $(this).closest("form"); - var any_checked = $form.find("tbody :checkbox").is(":checked"); - - // Enable the button if any checkbox is checked, - // Disable if all checkbox is cleared - if(any_checked) { - $form.find(".table_actions button.btn-danger").removeClass("disabled"); - }else { - $form.find(".table_actions button.btn-danger").addClass("disabled"); - } - }); } }; @@ -223,6 +210,18 @@ horizon.addInitFunction(function() { checkboxes.prop('checked', is_checked); }); + $("div.table_wrapper, div.modal_wrapper").on("click", ':checkbox', function (evt) { + var $form = $(this).closest("form"); + var any_checked = $form.find("tbody :checkbox").is(":checked"); + // Enable the button if any checkbox is checked, + // Disable if all checkbox is cleared + if(any_checked) { + $form.find(".table_actions button.btn-danger").removeClass("disabled"); + }else { + $form.find(".table_actions button.btn-danger").addClass("disabled"); + } + }); + horizon.datatables.add_table_checkboxes($('body')); horizon.datatables.set_table_sorting($('body')); horizon.datatables.set_table_filter($('body'));