Hi, can anybody help me with my problem please? On my site I used tree javascript utility to generate tree list of items. But there are many items so I need load them from DB with ajax. But if i do this (load some data and then build new list <ul id='tree'>..... ) this script doesn't work.. Maybe it must be refreshed after rebuild ul with JS DOM operations?? But how can I do it? If I generate <ul> with JS and not after ajax it works. Thanks a lot!
this is sample code:
function handle(xhr, json) // ajax handle function
{
var tree = document.getElementById('treediv'); // this three lines don't work here
tree.innerHTML = "<ul class='tree'>.... "; // (tree is generated but no 'recognized'
appendLoader(autoInit_trees); // => there are not +- buttons, folder icons etc..
}
function getData(par) // make ajax request
{
var myAjax = new Ajax.Request('../getMarques',
{method: 'get', parameters: { ... },
onComplete: handle});
// but if I put them (=three lines) here it's ok .... but I must use ajax to load data, how? :(((
}