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):

<ul class="treeList treeview" id="openExistingTree">
    <li class="expandable" id="3">
        <div class="hitarea hasChildren-hitarea expandable-hitarea"></
div>
        <div class="hitarea hasChildren-hitarea expandable-hitarea"></
div>
        <span></span>
        <ul></ul>
    </li>
    <li class="expandable" id="4">
        <div class="hitarea hasChildren-hitarea expandable-hitarea"></
div>
        <div class="hitarea hasChildren-hitarea expandable-hitarea"></
div>
        <span></span>
        <ul></ul>
    </li>
    <li class="hasChildren expandable lastExpandable" id="5">
        <div class="hitarea hasChildren-hitarea expandable-hitarea
lastExpandable-hitarea"></div>
        <div class="hitarea hasChildren-hitarea expandable-hitarea"></
div>
        <span></span>
        <ul></ul>
    </li>
</ul>

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': '<a class=\"openExisting\" title=\"Matthews test calc\"
href=\"javascript:void(0);\" elemName=\"Matthews test calc\" onclick=
\"Apx.CalcBuilder.openCalc(this, 1);\">Matthews test calc</a> <br/
><span class=\"resolution\">Hour, Location, Participant</span>'}]"

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

Reply via email to