Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Sandaly KEITA on Sep 26, 2008 08:43
open dhtmlx forum
How to hide only one image in a dhtmlxTree?

Hi,

I would like to know if I can hide one image in a dhtmlxTree.

I can disabled all image with enableTreeImages but I want to hide some images.

Thank you
Answer posted by Stanislav on Sep 29, 2008 15:04

You can't hide image directly, but you can

- change image to transparent gif ( can be done through im0-im2 attributes in XML, or tree.setItemImage2 )
- change size of image to 1px or 0px ( imwidth, imheight attributes in XML , or tree.setIconSize  )

Answer posted by Sandaly KEITA on Sep 30, 2008 05:50
Thanks!

It works very well with IE but there's a little problem with Firefox and setIconSize. In fact, I don't know if it's a setIconeSize problem or if it's normal. With IE, I have no space before the text but with Firefox, I have one. As if with firefox, there's always a space for image whatever image size (tree.setIconSize(1,1,'glace'); ).

Thanks
Answer posted by Support on Sep 30, 2008 08:24
There must not be any difference in setIconSize in both IE and FF
If issue still occurs for you - please provide info for which version of FF and which DOCTYPE issue occurs.
Answer posted by Sandaly KEITA on Sep 30, 2008 10:02
I'm using Firefox 3.0 with this DOCTYPE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Answer posted by Support on Oct 01, 2008 02:46
Problem confirmed, we will fix it in next version. 
To achieve correct result in all browsers with current version, please use command in next way. 

tree.setIconSize("1px","1px","books");
Answer posted by Sandaly KEITA on Oct 01, 2008 04:43
It's work very well!

Thank you for your great responsiveness