By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,971 Members | 907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,971 IT Pros & Developers. It's quick & easy.

Tree Challenge: Dynamically Creating Radio tree- Very Slow in IE

P: 1
Hi All,
I am new here and want to get some help for speeding up and resolving IE issue while creating tree using ajax.

My tree contains radio buttons at each level and I am getting all tree data from database. To speed up, what I am doing is to have tree in session at server side
and whenever ajax needs the tree , it sends appropriate tree key request and get the tree object from server.

My problem starts while processing huge tree. I have products tree object which is very huge and IW is taking 15 secs to build the tree and also hangs for 15 seconds. Firefox and mozilla hands this tree creation pretty neatly.

I am also building this tree on back ground on page load so that I have the tree ready when user clicks on + sign to get the tree.

I am building tree by using this method recursively.

Expand|Select|Wrap|Line Numbers
  1. function createMLNode(tagId,tagDesc){
  2.     var liElm = null;
  3.     var radioElm = null;
  5.     // Creating List Item - html tag
  6.     liElm = document.createElement("li");
  7. = tagId;
  9. // treeSelected is global variable contains information about 
  10. // which tree + sign has clicked.
  11. radioElm = document.createElement('<input type="radio" name="'+ "radio_" + treeSelected + '" />');
  13.     radioElm.className="height";
  15. = "radio-" + tagId;
  17.     radioElm.onclick = function(evt) {selectTagIdForRadio(tagId , treeSelected);} ;
  18.     liElm.appendChild(radioElm);
  19.     liElm.appendChild(document.createTextNode(tagDesc));
  21.     return liElm;
  22. }
Please help me so that I can encounter the IE hang issue or any other advice which can speed up tree building for large tree.

Thanks for your valuable suggestions.

May 21 '07 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 16,027
It might be a memory leak, but not sure. You could try using innerHTML since it's faster.
Mar 1 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.