Hi again,
it appears that the ClientNodeExpanding event is not fired when a node that has no children gets a child, and is then expanded with node.expand(). It also doesn't fire with node.set_expanded(true). Here is a sample code:
If I do g_parent_node.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.ServerSideCallBack) before expanding, the ClientNodePopulated event is fired, but that is not what I want.
Regards,
Fredrik
Mallverkstan
it appears that the ClientNodeExpanding event is not fired when a node that has no children gets a child, and is then expanded with node.expand(). It also doesn't fire with node.set_expanded(true). Here is a sample code:
var retvals = retval.split("|"); /* retval is a string such as : |
"10879|Produktgrupp «Ny produktgrupp»|PRODUKTGRUPP|/Icons/TreeView/ImageCreate.aspx?nodetype=PRODUKTGRUPP&alias=False&icontype=normal|/Icons/TreeView/ImageCreate.aspx?nodetype=PRODUKTGRUPP&alias=False&icontype=expanded|Ny produktgrupp" */ |
var node_id = retvals[0]; |
var tooltip = retvals[1]; |
var category = retvals[2]; |
var imageurl = retvals[3]; |
var expimageurl = retvals[4]; |
var nodename = retvals[5]; |
var node = new Telerik.Web.UI.RadTreeNode(); |
node.set_text(nodename.replace(/</g,"<").replace(/>/g, ">")); |
node.set_target("content"); |
node.set_value(node_id); |
var navurl = "content.aspx?id_catalogue=1&data_id_node="+node_id+"&id_category="+category+"&tree_id_node="+node_id; |
node.set_navigateUrl(navurl); |
node.set_imageUrl(imageurl); |
node.set_expandedImageUrl(expimageurl); |
node.set_contextMenuID(category); |
node.set_category(category); |
// g_parent_node is a global variable with the parent node |
g_parent_node.get_nodes().insert(0, node); |
node.get_textElement().title = tooltip; |
if (!g_parent_node.get_expanded()) { |
g_parent_node.expand(); /* If g_parent_node had no childnodes before I added one in the code above, this expansion can not be caught!! Nither ClientNodeExpanding nor ClientNodeExpanded is fired. But g_parent_node is actually expanded! */ |
} |
If I do g_parent_node.set_expandMode(Telerik.Web.UI.TreeNodeExpandMode.ServerSideCallBack) before expanding, the ClientNodePopulated event is fired, but that is not what I want.
Regards,
Fredrik
Mallverkstan