[ansel] Tree view almost done

Heath S. Hendrickson heath at outerspaceconsultants.com
Wed Feb 18 19:22:49 PST 2004


 I'm 99% done with the new tree view.  I didn't use Horde_Tree simply 
because I couldn't get my hands wrapped around how to use it.  I'm just 
having a problem with dynamically changing the link that the 
gallery_preview image goes to.  I've tried using the 
document.$owner_link.href = $owner_view_url[]; approach, but all I get 
are javascript errors complaining that document.$owner_link doesn't have 
any properties.

Here's the JS snippet:

link = document.getElementById('<?php echo $owner ?>_link');
link.href = <?php echo $owner ?>_view_url[$id];   // $id is passed into 
the JS


And here's the definition of the link:

<td class="preview"><?php echo Horde::link('" name="' . $owner . 
'_link"') . Horde::img('', _("Gallery Preview"), 'vpace="5" 
class="solidbox" name="' . $owner . "_preview"') ?></a></td>


The resulting output in the browser looks like:

The JS:

    link = document.getElementById('heath_link');
    link.href = heath_view_url[$id];


The link:

<td class="preview"><a href="" name="heath_link"><img src="/horde/ansel/graphics/" alt="Gallery Preview" title="Gallery Preview" vspace="5" class="solidbox" name="heath_preview" /></a></td>


Anyone have any suggestions on what I'm doing wrong here?

heath


More information about the ansel mailing list