// ob_em_EasyMenu1 is the ID of our EasyMenu (ob_em_ + the id from the aspx page). function ob_OnNodeExpand(id, dynamic) { // add client side code here //alert("OnNodeExpand on: " + id + " " + dynamic); if(ob_ev("OnNodeExpand")) { if(document.getElementById(id).parentNode.parentNode.firstChild.firstChild.className == "ob_t8") { id = "root"; } if(typeof ob_post == "object") { ob_post.AddParam("id", id); //Change "TreeEvents.aspx" with the name of your server-side processing file ob_post.post("TreeEvents.aspx", "OnNodeExpand"); } else { alert("Please add obout_AJAXPage control to your page to use the server-side events"); } } //attach menu to dynamic node if ( dynamic ){ ob_attachMenuToNode( document.getElementById( id ), true ); } } function ob_attachMenuToNode( node, attToChild ){ if ( ob_em_Menus != null ) { if( typeof(ob_em_EasyMenu1) == "undefined") { return; } var childCount = ob_getChildCount ( node ); for ( var i=0; i< childCount; i++) { var child = ob_getChildAt ( node, i, false ); // attach menu to node try{ var childId = child.id; if ( childId == null ) { continue; } ob_em_EasyMenu1.attachToControl( child.id ); if ( attToChild == true ) { //continue attach to childs node. if ( ob_getChildCount ( child ) > 0 ) { ob_attachMenuToNode( child, true ); } } }catch(ex){} } } }