jannbmsy / dynatree

Automatically exported from code.google.com/p/dynatree
0 stars 0 forks source link

Need mechanism to "hide" a node #472

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I would like to hide a node.  I've tried adding a class to the node (if it is 
hidden) with css:  'visibility: hidden'   and setting hideCheckbox=true

but then I get the display as shown in the attached image 'current.png' where I 
try to hide nodes "layerC" and "layerD"

I would like to get the display shown in the attached image 'desired.png' where 
the hidden nodes are collapsed completely.

Original issue reported on code.google.com by graffle...@gmail.com on 21 Jan 2014 at 5:36

Attachments:

GoogleCodeExporter commented 8 years ago
My solution: 

I added a new node attribute 'hidden'

$.ui.dynatree.nodedatadefaults = {
    ....
    hidden: false, // is node hidden

then added a line #475
    this.li.style.display = ( data.hidden ? "none" : "visible" )

this got me to the image shown in 'desired.png'

Original comment by graffle...@gmail.com on 21 Jan 2014 at 6:32

GoogleCodeExporter commented 8 years ago
> I've tried adding a class to the node (if it is hidden) with css:  
'visibility: hidden'  

have you tried to use CSS 'display: none' instead?

Original comment by moo...@wwwendt.de on 21 Jan 2014 at 8:51

GoogleCodeExporter commented 8 years ago
WRT idea to add 'display: none' instead... great idea... I just tried that.

It doesn't work because the display style is overridden by the dynatree-node 
style which sets display: inline-block

The other problem is that the display:none should be on the <LI> not on the 
<span>

see attached file "suggestionFailed.png"

Original comment by graffle...@gmail.com on 22 Jan 2014 at 2:35

Attachments:

GoogleCodeExporter commented 8 years ago
That would be a new feature, so it's rather a topic for the successor 
'Fancytree'.
Have a look at the 'filter' extension there.

Original comment by moo...@wwwendt.de on 25 Jan 2014 at 11:26