From c7e3f36391a7e7c8907e5ca8f965a613f61df934 Mon Sep 17 00:00:00 2001 From: phamt Date: Thu, 15 Mar 2012 13:38:00 +0000 Subject: [PATCH] Fixed select all checkbox in nodes table. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11862 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/custom/customUtils.js | 62 ++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/xCAT-UI/js/custom/customUtils.js b/xCAT-UI/js/custom/customUtils.js index 031f51d5e..cb97008ef 100644 --- a/xCAT-UI/js/custom/customUtils.js +++ b/xCAT-UI/js/custom/customUtils.js @@ -456,6 +456,29 @@ function appendProvisionSection(plugin, container) { * @returns Nothing */ function appendProvision4Url(container){ + // Get provision tab ID + var tabId = container.parents('.tab').attr('id'); + + // Create node fieldset + var nodeFS = $('
'); + var nodeLegend = $('Node'); + nodeFS.append(nodeLegend); + container.append(nodeFS); + + var nodeAttr = $('
'); + nodeFS.append($('
')); + nodeFS.append(nodeAttr); + + // Create image fieldset + var imgFS = $('
'); + var imgLegend = $('Image'); + imgFS.append(imgLegend); + container.append(imgFS); + + var imgAttr = $('
'); + imgFS.append($('
')); + imgFS.append(imgAttr); + var query = window.location.search; var args = query.substr(1).split('&'); var parms = new Object(); @@ -479,14 +502,15 @@ function appendProvision4Url(container){ if (parms['tftpserver']) tftpserver = parms['tftpserver']; - container.append('
'); - container.append('
'); - container.append('
'); - container.append( '
'); - container.append('
'); - container.append('
'); - container.append('
'); - container.append('
'); + nodeAttr.append('
'); + + imgAttr.append('
'); + imgAttr.append('
'); + imgAttr.append( '
'); + imgAttr.append('
'); + imgAttr.append('
'); + imgAttr.append('
'); + imgAttr.append('
'); return; } @@ -713,7 +737,7 @@ function createNodesTable(group, outId) { // Create table to hold nodes var nTable = $('
'); - var tHead = $(' Node '); + var tHead = $(' Node '); nTable.append(tHead); var tBody = $(''); nTable.append(tBody); @@ -730,7 +754,7 @@ function createNodesTable(group, outId) { outId.empty().append(nTable); - if (index > 10) + if (nodes.length > 10) outId.css('height', '300px'); else outId.css('height', 'auto'); @@ -760,4 +784,22 @@ function getCheckedByObj(obj) { } return str; +} + +/** + * Select all checkboxes in the table + * + * @param event + * Event on element + * @param obj + * Object triggering event + * @return Nothing + */ +function selectAll4Table(event, obj) { + // Get datatable ID + // This will ascend from + var tableObj = obj.parents('table').find('tbody'); + var status = obj.attr('checked'); + tableObj.find(' :checkbox').attr('checked', status); + event.stopPropagation(); } \ No newline at end of file