diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js index d3fa07062..65e5354df 100644 --- a/xCAT-UI/js/nodes/nodes.js +++ b/xCAT-UI/js/nodes/nodes.js @@ -203,6 +203,7 @@ function loadNodes(data) { // Add column for check box, node, ping, and power sorted.unshift('', 'node', 'ping', 'power'); + sorted[0] = ''; // Create a datatable var dTable = new DataTable('nodesDataTable'); @@ -1627,8 +1628,14 @@ function deleteNode(tgtNodes) { 'color' : '#BDBDBD' }); }); + + var cancelBtn = createButton('Cancel'); + cancelBtn.bind('click', function(){ + myTab.remove($(this).parent().parent().attr('id')); + }); deleteForm.append(deleteBtn); + deleteForm.append(cancelBtn); myTab.add(newTabId, 'Delete', deleteForm); myTab.select(newTabId); @@ -2148,9 +2155,6 @@ function setGroupsCookies(data) { * @return Row element */ function getNodeRow(tgtNode, rows) { - // Get nodes datatable - var dTable = getNodesDataTable(); - // Find the row for ( var i in rows) { // Get all columns within the row @@ -2181,6 +2185,10 @@ function getNodesChecked() { var nodes = $('#nodesDataTable input[type=checkbox]:checked'); for ( var i = 0; i < nodes.length; i++) { tgtNodes += nodes.eq(i).attr('name'); + + if ("" == tgtNodes){ + continue; + } // Add a comma in front of each node if (i < nodes.length - 1) { @@ -2189,4 +2197,10 @@ function getNodesChecked() { } return tgtNodes; +} + +function selectAllCheckbox(event, obj){ + var status = obj.attr('checked'); + $('#nodesDataTable :checkbox').attr('checked', status); + event.stopPropagation(); } \ No newline at end of file diff --git a/xCAT-UI/js/ui.js b/xCAT-UI/js/ui.js index d3c3622dd..9a413baa3 100644 --- a/xCAT-UI/js/ui.js +++ b/xCAT-UI/js/ui.js @@ -104,6 +104,10 @@ Tab.prototype.select = function(id) { */ Tab.prototype.remove = function(id) { // To be continued + var selectorStr = 'a[href="\#' + id + '"]'; + var selectTab = $(selectorStr, this.tab).parent(); + var index = ($('li', this.tab).index(selectTab)); + this.tab.tabs("remove", index); }; /**