Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by plexofoam on Nov 17, 2008 15:28
open dhtmlx forum
Dragging by TEXT is blocked in dhtmlxTree.

Hello,

I am having a slight error using dhtmlxTree.

I try to drag while grabing the text and I get a small "stop-slash" icon. I am not able to drag. When I grab the tree item image, I can drag without a problem.


Here is the code I am using to write the JSON array tree items.

echo "[".$node['ObjectID'];
echo ",";
echo $node['ParentID'];
echo ",\"";
echo "<a href='source.php?tab=inv&objectid=".$node['ObjectID']."'>".$node['Name']."</a>";
echo "\"]";


Here is the script I am using on my page.

<script>
tree=new dhtmlXTreeObject("treeboxbox_tree","300px","200px",0);
tree.setImagePath("codebase/imgs/csh_bluefolders/");
tree.enableDragAndDrop(true);
tree.enableCheckBoxes(1);
tree.loadJSArrayFile("jsontree.php?page=roots");
</script>


Here is the HTML output I get.

<tr>
<td class="standartTreeImage">
<img src="codebase/imgs/csh_bluefolders/line3.gif" style="margin: 0pt; padding: 0pt; width: 18px; height: 18px;" align="absmiddle" border="0">
</td>
<td width="20">
<img style="width: 16px; height: 16px;" src="codebase/imgs/csh_bluefolders/iconUncheckAll.gif" align="absmiddle">
</td>
<td style="width: 18px;" class="standartTreeImage">
<img src="codebase/imgs/csh_bluefolders/leaf.gif" style="margin: 0pt; padding: 0pt; width: 18px; height: 18px;" align="absmiddle" border="0">
</td>
<td style="width: 100%; font-size: 10pt; cursor: pointer;" class="standartTreeRow" nowrap="nowrap">
<span style="padding-left: 5px; padding-right: 5px;" class="standartTreeRow">
<a href="source.php?tab=inv&objectid=3625">test 11</a>
</span>
</td>
</tr>

Is there a way to drag from the text and the image?
Answer posted by Support on Nov 18, 2008 02:08
In which browser issue occurs for you?
The described behavior must not occur in normal case, it may be caused by text selection enabling ( which requires changes in dhtmlxtree.js or dhtmlxtree.css)
Be sure that dhtmlxtree.css correctly included in page ( without css file, described issue can occur in FF ) 


Answer posted by plexofoam on Nov 19, 2008 09:53

Thank you for the response.

How would I check and/or change dhtmlxtree.js or dhtmlxtree.css to make the "TEXT with a link" draggable?

Answer posted by Support on Nov 20, 2008 02:23
Actually you need not any additional steps, tree items with inline HTML elements can be draged in same way as default ones. 
Please check attached sample.
Attachments (1)
Answer posted by plexofoam on Nov 20, 2008 05:54

I still get an error with your example.

I've attached images to show you what it looks like.

My Internet Explorer version is 7 and the settings are set to default.

 

 

Attachments (2)
Answer posted by Support on Nov 20, 2008 06:39
To resolve issue in IE - add ondragstart attribute to html code of link 
<item text="&lt;a href='http://books.com' ondragstart='return false' &gt;Books&lt;/a&gt;" id="books" open="1" im0="tombs.gif" im1="tombs.gif" im2="iconSafe.gif" />