I had to handle this situation over a week ago.
   
  I just wrote a couple lines to remove all tree attributes from the generated 
source and then rebuilt the tree.
   
     $('.sample ul:eq(0)').removeClass('treeview');
     $('.sample li').removeClass();   
     $('.sample ul div').remove();
     $('.sample ul').removeAttr('style');
   
     $('.sample ul').tree();
   
  See my working sample here. 
http://www.2whoa.com/apps/demo/apex-admin/hierarchy.html
   
  Works great on IE6 and FF. Haven't tested it on a Mac yet.
   
  I hope that helps.
   
   
   
   
   
  

rolfsf <[EMAIL PROTECTED]> wrote:
  
sorry, didn't realize how badly the formatting was! Let me try again.

We ran into a problem when trying to set up a refresh button on
an async treeview implementation. Our tree contents will be changing
all the
time. Basically, we need to know how to blow away the contents of the
UL and
then re-insert them. What's happening is that on each click of the
refresh
we're getting an additional set of hitarea divs.

For the refresh button click, currently we're using
$('#openExistingTree').empty();

then to re-initialize:
$('#openExistingTree').treeview({ url: "CalcBldrOpenExisting.ashx" });

after the initial load, the markup looks fine. After clicking
'refresh' once, it looks like this (note duplicate divs):

  
  
   
  div>
  div>

  




  
   
  div>
  div>

  




  
   
  lastExpandable-hitarea">

  div>

  






Additional notes from our developer:

The initial json returned is:
"[{'text': 'Private Drafts','id': 3, 'hasChildren': true},{'text':
'Shared Drafts','id': 4, 'hasChildren': true},{'text': 'Published
Calculations','id': 5, 'hasChildren': true}]"

Then, when the user clicks on ‘Private Drafts’, I return the
following:

"[{ 'text': 'href=\"javascript:void(0);\" elemName=\"Matthews test calc\" 
onclick=
\"Apx.CalcBuilder.openCalc(this, 1);\">Matthews test calc 
>Hour, Location, Participant'}]"

After clearing the tree list, I reinitialize and the returned json is
IDENTICAL to that shown above, but the treeview jquery code does not
interpret it the same way.

--------------

Any help would be appreciated!

Rolf


       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

Reply via email to