Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When event is finished Close Window

Status
Not open for further replies.

venomdesign

Programmer
Apr 6, 2001
18
0
0
US
I have xml data populating a product type table, when a user click a 2 states are shown, depending on which state the user clicks a event is fired and if there are a lot of records for that state a pop-up window pops up saying loading.... I can get the pop-up to come up, but when the data is finished loading I need the window to close. Here is a chunk of code that I have written, any help would be great.

function doclick(service, state) {
var hasChildren = false;
var srcElem = window.event.srcElement;
var recNum = getParentWithTag(srcElem, "TABLE").recordNumber;
var entityId = ptypes.XMLDocument.selectSingleNode("//" + parentNodeName + "[" + (recNum-1) + "]/@" + parentNodeIdName).text;
var root = ptypes.XMLDocument.selectSingleNode("//" + parentNodeName + "[@" + parentNodeIdName + "='" + entityId + "']/" + state);

for (var i = 0; i<root.childNodes.length; i++) {
if (root.childNodes.nodeName == childNodeName) {
hasChildren = true;
break;
}
}

if (!hasChildren) {
//newDoc will be used to hold new data
var newDoc = newData.XMLDocument;
newDoc.async = false;
service = &quot; + service + &quot;&entityId=&quot; + entityId + &quot;&status=&quot; + state;

newDoc.load(service);
//alert(newDoc.xml);
var newNode = newDoc.documentElement;

var newNodeList = newNode.selectNodes(&quot;//&quot; + childNodeName);
var newNodeLength = newNodeList.length;

for(var i=0; i<newNodeLength; i++) {
root.appendChild(newNodeList.nextNode);
}
}
//alert(ptypes.xml);
//alert(service);
expandIt();
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top