Home - Forums-.NET - FlyTreeView (ASP.NET) - Client-Side setImageUrl()

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Client-Side setImageUrl()
Link Posted: 24-Mar-2009 08:44
I had implemented a text search function for a flytreeview server-side using ExpandAllParent() and ImageUrl().  I had added a custum ImageUrl on the nodes where the node text contained the text search string, so the user could easily identify the matched nodes.  

For performance reasons I would like to do this now client-side.  When I use setImageUrl() on the node, it doesn't seem to work.  I assume I cannot change certain node font colors to a different color.  Does this work client-side?  I assume there is no equivalent ExpandAllParent() client-side, but can work around this.

The flytreeview is displayed on a button click pop-up panel and the selected node text is then displayed in a textbox on the form and the panel is hidden.

Thanks.
Link Posted: 24-Mar-2009 09:41
[quote="tiobst"]When I use setImageUrl() on the node, it doesn't seem to work.

Actually setImageUrl works (as you can see it in stock demo), but there's one limitation - node should already have image defined when loaded from server. I mean even if you do not want to show image initially, you should put a blank one as node.ImageUrl. So that setImageUrl() will be able to change it to required one.
Basically - client-side setImageUrl() can change node image, not to add.

[quote="tiobst"]I assume I cannot change certain node font colors to a different color.  Does this work client-side?

You can get to node element using node.getElement() function. So you can further do
var el = node.getElement();
el.style.color = 'blue';

... or you can add css class to this element, etc. Also, you can set CssClass to node at server-side, and alter it at client-side (CSS rules can be changed at client-side).
Link Posted: 25-Mar-2009 02:26
Thanks.  That is exactly what I need.