Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by James Mackinnon on Dec 17, 2007 12:30
open dhtmlx forum
Clicking folder in tree - Needs link to div using javascript

Hi

 

I have the javascript, that is not an issue here, the issue is adding the code to the tree folders

 

I want to click a tree container and have it pass the following off which will feed into a div

 

<a class=whitetext href="javascript:ajaxpagefetcher.load('main', 'modules/<?php echo $org_mods_row[modvar];?>/main.php', true);"> <img src=modules/<?php echo $org_mods_row[modvar];?>/images/QL_messages.gif border=0></a>

 

The item main is my div and I am trying to send it 'modules/[modvar]/main.php

 

I figured I would use an onclick event but hadn't much luck using it to pass off

 

Sorry for flooding the KB with of my questions of late, I'm in a tight timeline to build this and trying to convert a finished product from frames / iframes to ajax in 15 days is not fun

 

 

Thanks

 

James

Answer posted by Support on Dec 18, 2007 01:51
If I understood you correctly , it can be done similar to next

tree.attachEvent("onClick",function(id){
    ajaxpagefetcher.load('main', 'modules/<?php echo $org_mods_row[modvar];?>/main.php', true);
});