diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js index bfab4ad8e..5c792f3ba 100644 --- a/xCAT-UI/js/nodes/nodes.js +++ b/xCAT-UI/js/nodes/nodes.js @@ -3288,25 +3288,4 @@ function jump2Provision(tgtNodes){ } window.location.href = 'provision.php?nodes=' + tgtNodes + '&arch=' + archType + '&master=' + master + '&tftpserver=' + tftpserver + '&nfsserver=' + nfsserver; -} - -/** - * Adjust datatable column size - * - * @param tableId - * Table ID - * @return Nothing - */ -function adjustColumnSize(tableId) { - var cols = $('#' + tableId).find('tbody tr:eq(0) td'); - - // If the column size is zero, wait until table is initialized - if (!cols.eq(1).outerWidth()) { - adjustColumnSize(tableId); - } else { - for (var i in cols) { - var headers = $('#' + tableId + '_wrapper .dataTables_scrollHead .datatable thead tr th').eq(i); - headers.css('width', cols.eq(i).outerWidth()); - } - } } \ No newline at end of file diff --git a/xCAT-UI/js/service/service.js b/xCAT-UI/js/service/service.js index 74fd8527c..82a2f1c98 100644 --- a/xCAT-UI/js/service/service.js +++ b/xCAT-UI/js/service/service.js @@ -550,7 +550,7 @@ function loadNodePing(data) { // Hide status loader var pingCol = $('#' + nodesDTId + '_wrapper .dataTables_scrollHead .datatable thead tr th:eq(2)'); pingCol.find('img').hide(); - datatable.fnDraw(); + adjustColumnSize(nodesDTId); } /** @@ -610,7 +610,7 @@ function loadPowerStatus(data) { // Hide power loader var powerCol = $('#' + nodesDTId + '_wrapper .dataTables_scrollHead .datatable thead tr th:eq(3)'); powerCol.find('img').hide(); - datatable.fnDraw(); + adjustColumnSize(nodesDTId); } /** @@ -670,7 +670,7 @@ function loadGangliaStatus(data) { // Hide Ganglia loader var gangliaCol = $('#' + nodesDTId + '_wrapper .dataTables_scrollHead .datatable thead tr th:eq(4)'); gangliaCol.find('img').hide(); - datatable.fnDraw(); + adjustColumnSize(nodesDTId); } /** diff --git a/xCAT-UI/js/ui.js b/xCAT-UI/js/ui.js index 5f693dedf..57b5bf025 100644 --- a/xCAT-UI/js/ui.js +++ b/xCAT-UI/js/ui.js @@ -815,6 +815,27 @@ function openSettings() { }); } +/** + * Adjust datatable column size + * + * @param tableId + * Table ID + * @return Nothing + */ +function adjustColumnSize(tableId) { + var cols = $('#' + tableId).find('tbody tr:eq(0) td'); + + // If the column size is zero, wait until table is initialized + if (!cols.eq(1).outerWidth()) { + adjustColumnSize(tableId); + } else { + for (var i in cols) { + var headers = $('#' + tableId + '_wrapper .dataTables_scrollHead .datatable thead tr th').eq(i); + headers.css('width', cols.eq(i).outerWidth()); + } + } +} + /** * Set menu theme *