Literally, not using document.write but document.getElementById("mydiv").innerHTML?
Or another way to create a menu onclick?
Or are there any files that are not stripped to one line, so i can do it by myself?
Like the question. It's exactly what I'am trying to do with tigra tree.
actually you can do
document.getElementById("mydiv").innerHTML = new tree(TREE_ITEMS, TREE_TPL);
The tree will even display in the div-element, but.... after that it hangs.
I got no clue, what this is all about, but I'd like to combine perl-Ajax with tigra tree.
But you didn't get an answer for more than two years. Probably there is no solution to that.
new tree|menu (..) call returns the reference to the tree object, not its HTML so what you try doesn't work.
The tree uses document.write(..) method which writes the HTML directly into the document at the page initialization time. The tree/menu must be redesigned to allow initialization after the page is loaded. Submit a support ticket if you're interested in the customization.
For the "menu onclick" feature check out pop-up mode supported in Tigra Menu GOLD.
so all it takes:
replace document.write(this.a_children.tmpQ()) in tree.js with
This actually does work!
One could easily change
function tree(tmp0,tmp1,tmp2) to function tree(tmp0,tmp1,tmp2,tmp3)
and may then fill any div element
by calling the tree
new tree (TREE_ITEMS, TREE_TPL, 'myTree', 'mydiv');
probably something like that could be added to upcoming versions.
this gives you the HTML alright, but there may be problems down the road because for each call like this all the references must be checked to ensure everything corresponds to the HTML. Please make sure to post the updates if you detect the problem with your approach.
Yes your objection seems to be reasonable. In my case I didn't encounter any problems
because the tree will be rebuild any time I call the perl-Ajax routine. Actually the tree is
rebuild entirely and this is what it was ment for. In a different <div> data in a database
is manipulated and after that the tree is called again in the server and the treediv
is written again. Probably this is wrong thinking, but the result is exactly what I expected.
The tigra tree is so fast, that rebuilding actually doesn't have any influence on the
timing of my application. Ajax is much slower. Anyway weird concepts, but very fashionable.
Probably the idea is working only in this environment. Thank you for your objection.