Closed GoogleCodeExporter closed 8 years ago
Try to put the <ul> outside (after) the <span>.
That seems to produce better results
<li data="icon: 'FirstLevelA.ico'">First Level 1.1</li>
<li data="icon: 'FirstLevelB.ico'">
<span style="DISPLAY: inline-block;">
<span style="DISPLAY: inline-block;" menu="1,KPHL,KPHL - KBWI" showMenuAtCursor="true" title="">KPHL</span>
<span style="DISPLAY: inline-block;">-</span>
...
</span>
<ul>
<li data="icon: 'SecondLevelA.ico'">
<span style="DISPLAY: inline-block;" menu="2,SOMEDATA1" showMenuAtCursor="true" title="">Route 1</span>
<ul>
<li data="icon: 'ThirdLevelA.ico'">
Original comment by moo...@wwwendt.de
on 23 Nov 2011 at 5:51
After further examination of the dynatree code specifically the _createFromTag
method I was able to obtain the correct output with all icons and text
displayed. The key is to nest each nodes spans separately. Do not have the end
span tag of a parent follow and child nodes or spans. The correct way to
arrange spans is as
follows:
<ul xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<li data="icon: 'FirstLevelA.ico'">First Level 1.1</li>
<li data="icon: 'FirstLevelB.ico'">
<span style="DISPLAY: inline-block;">
<span style="DISPLAY: inline-block;" menu="1,KPHL,KPHL - KBWI" showMenuAtCursor="true" title="">KPHL</span>
<span style="DISPLAY: inline-block;">-</span>
<span style="DISPLAY: inline-block;" menu="1,KBWI,KPHL - KBWI" showMenuAtCursor="true" title="">KBWI</span>
<span style="DISPLAY: inline-block;">(</span>
<span style="DISPLAY: inline-block;" menu="0,KPHL - KBWI" showMenuAtCursor="true" title="">PHILADELPHIA INT / BALTIMORE WASHINGTON</span>
<span style="DISPLAY: inline-block;">)</span>
</span>
<ul>
<li data="icon: 'SecondLevelA.ico'">
<span style="DISPLAY: inline-block;">
<span style="DISPLAY: inline-block;" menu="2,SOMEDATA1" showMenuAtCursor="true" title="">Route 1</span>
</span>
<ul>
<li data="icon: 'ThirdLevelA.ico'">
<span style="DISPLAY: inline-block;">
<span style="DISPLAY: inline-block;" menu="3,SOMEDATA2" showMenuAtCursor="true" title="">ABC - Description of ABC</span>
</span>
</li>
<li data="icon: 'ThirdLevelA.ico'">
<span style="DISPLAY: inline-block;">
<span style="DISPLAY: inline-block;" menu="3,SOMEDATA3" showMenuAtCursor="true" title="">123 - Description of 123</span>
</span>
</li>
<li data="icon: 'ThirdLevelA.ico'">
<span style="DISPLAY: inline-block;">
<span style="DISPLAY: inline-block;" menu="3,SOMEDATA4" showMenuAtCursor="true" title="">XYZ - Description of XYZ</span>
</span>
</li>
<li data="icon: 'ThirdLevelA.ico'">
<span style="DISPLAY: inline-block;">
<span style="DISPLAY: inline-block;" menu="3,SOMEDATA5" showMenuAtCursor="true" title="">456 - Description of 456</span>
</span>
</li>
</ul>
</li>
</ul>
</li>
</ul>
The key lines of dynatree code dealing with this issue are:
var $liSpan = $li.find(">span:first"); line 2487
var title;
if( $liSpan.length ) {
// If a <li><span> tag is specified, use it literally.
title = $liSpan.html();
} ....
The reason you must wrap each nodes spans in an empty span is because lines
2487... look for the first span and then query it's length. Only child spans
will return a value greater than 0 in the test for length. You want your spans
treated like text, that is used literally.
Original comment by adb...@hotmail.com
on 28 Nov 2011 at 3:34
Original comment by moo...@wwwendt.de
on 28 Dec 2011 at 10:36
Original issue reported on code.google.com by
adb...@hotmail.com
on 22 Nov 2011 at 10:47