From 40f482fb1a896767720ea663f4f566b03088cc5d Mon Sep 17 00:00:00 2001 From: xq2005 Date: Fri, 28 Jan 2011 03:16:48 +0000 Subject: [PATCH] load data at first click git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8763 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/nodes/nodes.js | 3 +-- xCAT-UI/js/nodes/physical.js | 13 +++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js index d65add6ce..a217500c8 100644 --- a/xCAT-UI/js/nodes/nodes.js +++ b/xCAT-UI/js/nodes/nodes.js @@ -142,7 +142,6 @@ function loadGroups(data) { // Create loader var loader = $('
').append(createLoader()); - var loader2 = $('
').append(createLoader()); // Create a tab for this group var tab = new Tab('nodesPageTabs'); @@ -150,7 +149,7 @@ function loadGroups(data) { tab.init(); $('#nodes').append(tab.object()); tab.add('nodesTab', 'Nodes', loader, false); - tab.add('graphTab', 'Graphical', loader2, false); + tab.add('graphTab', 'Graphical', '', false); $('#nodesPageTabs').bind('tabsselect', function(event, ui){ //for the graphical tab, we should check the graphical data first diff --git a/xCAT-UI/js/nodes/physical.js b/xCAT-UI/js/nodes/physical.js index 87c65b61f..d572dc5dd 100644 --- a/xCAT-UI/js/nodes/physical.js +++ b/xCAT-UI/js/nodes/physical.js @@ -4,8 +4,10 @@ var lparList; var graphicalNodeList; var selectNode; var graphicalDataType = ['nodetype.nodetype', 'ppc.parent', 'nodelist.status', 'vpd.mtm']; +var gettingDataFlag = false; function initGraphicalData(dataTypeIndex){ + gettingDataFlag = true; if (undefined == dataTypeIndex){ dataTypeIndex = 0; } @@ -34,6 +36,7 @@ function initGraphicalData(dataTypeIndex){ initGraphicalData(tempIndex); } else{ + gettingDataFlag = false; $('#graphTab').empty(); for (var temp in nodesList){ var nodeName = nodesList[temp]; @@ -100,6 +103,16 @@ function createPhysicalLayout(nodeList){ return; } + //it is getting data,so we had to wait now. + if(gettingDataFlag){ + return; + } + + //when the graphical layout is shown, do not need to redraw + if (1 < $('#graphTab').children().length){ + return; + } + //save the new selected nodes. if(graphicalNodeList){ for(var i in graphicalNodeList){