tobias.beuth
Junior Member
Posts: 3
Registered: 2/26/2004
Member Is Offline
|
| posted on 2/26/2004 at 01:07 PM |
|
|
Is there a way to write a Menu to a DIV and not to the Document?
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?
|
|
|
pkb
Junior Member
Posts: 4
Registered: 10/17/2006
Location: munich germany
Member Is Offline
|
| posted on 10/17/2006 at 01:01 PM |
|
|
Is there a way to write a Menu to a DIV and not to the Document?
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.
|
|
|
tigra
Administrator
Posts: 1984
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 10/17/2006 at 01:13 PM |
|
|
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.
|
|
|
pkb
Junior Member
Posts: 4
Registered: 10/17/2006
Location: munich germany
Member Is Offline
|
| posted on 10/19/2006 at 06:17 AM |
|
|
so all it takes:
replace document.write(this.a_children.tmpQ()) in tree.js with
document.getElementById('mydiv').innerHTML=this.a_children.tmpQ();
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
document.getElementById(tmp3).innerHTML=this.a_children.tmpQ();
by calling the tree
new tree (TREE_ITEMS, TREE_TPL, 'myTree', 'mydiv');
probably something like that could be added to upcoming versions.
|
|
|
tigra
Administrator
Posts: 1984
Registered: 6/17/2002
Location: US, CO
Member Is Offline
|
| posted on 10/19/2006 at 09:13 AM |
|
|
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.
|
|
|
pkb
Junior Member
Posts: 4
Registered: 10/17/2006
Location: munich germany
Member Is Offline
|
| posted on 10/19/2006 at 01:37 PM |
|
|
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.
|
|
|
mrcat
Newbie
Posts: 1
Registered: 10/25/2006
Location: New York
Member Is Offline
|
| posted on 10/26/2006 at 12:05 AM |
|
|
| Quote: | Originally posted by pkb
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);
|
I've done it for tigra menu. Just have to use DOM for creating items and little changes to calculate positions...
root level is become fixed, but other levels still have to have positions:absolute.
|
|
|