The UltraWebTree control gives the ability to add or remove nodes using javascript.
The UltraWebMenu does not have this functionality.
Are there any current workarounds?
Can the UltraWebMenu control be enhanced in the future to allow adding or removing items?
Thanks
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=8079
url affectation changes,
in my javascript function:
var
url = "<a href='ReportCriteriaAdmin.aspx?placeValuesBeforeTB_=savedValues&TB_iframe=true&height=480&width=420' title='New Folder' class='thickbox'>New folder2</a>";
topitems[0].setText(url);the problem is that when I check the topitems[0].getText() I have this:
<A class=thickbox title="New Folder" href="http://localhost:3209/ScoreCardAdmin/ReportFilterCriteria.aspx?ParentID=pppp&Type=tttt&placeValuesBeforeTB_=savedValues&TB_iframe=true&height=480&width=420">New folder2</A>
so my link in this case doesn't work correctly.
My url has been changed, I don't know how?
Thanks for reply.
Hi,
menu = igmenu_getMenuById('UltraWebMenu');
var topitems = menu.getItems();
url = "<a href='ReportCriteriaAdmin.aspx?placeValuesBeforeTB_=savedValues&TB_iframe=true&height=480&width=420' class='thickbox'>New folder2</a>";
topitems[0].setText(url);
the problem is that when I check the topitems[0].getText() I have this:
it makes some changes.
Thanks for replay.
Unfortunartely these Items DO SHOW UP ON THE MENU as empty. If you add a lot of items
you will have a long blank menu. It is very disappointing that we cannot add the items with javascript.
Gary
HI Erice,
There is a work around to your issue.
you can create a menu with some items that have their Text set to spaces and their Enable property set to false.
These items will not show up on the menu. You can then changed the Text and the Eanble property of this disable menu item via javascript.
In the sample i provide the first parent's child item is disabled. when you click the html button this item will appear with the text "hello"
Here is the code to do so :
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Infragistics2.WebUI.UltraWebNavigator.v7.3, Version=7.3.20073.38, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.WebUI.UltraWebNavigator" TagPrefix="ignav" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title><script language="javascript" type="text/javascript">// <!CDATA[
var mid = nullfunction Button1_onclick() {//debugger;var menu = igmenu_getMenuById(mid);var topitems = menu.getItems();var subitems = topitems[0].getItems();subitems[0].setText("hello");subitems[0].setEnabled(true);}function UltraWebMenu1_InitializeMenu(menuId){ //Add code to handle your event here. mid = menuId;}// ]]></script>
</head><body> <form id="form1" runat="server"> <div> <ignav:UltraWebMenu ID="UltraWebMenu1" runat="server" JavaScriptFilename="" JavaScriptFileNameCommon="" LeafItemImageUrl="" ParentItemImageUrl="" StyleSetName=""> <ItemStyle Cursor="Default" /> <Images> <SubMenuImage Url="ig_menuTri.gif" /> </Images> <IslandStyle BackColor="LightGray" BorderStyle="Outset" BorderWidth="1px" Cursor="Default"> </IslandStyle> <HoverItemStyle BackColor="DarkBlue" Cursor="Default" ForeColor="White"> </HoverItemStyle> <Levels> <ignav:Level Index="0" /> <ignav:Level Index="1" /> </Levels> <DisabledStyle Font-Names="MS Sans Serif" Font-Size="8pt" ForeColor="Gray"> </DisabledStyle> <SeparatorStyle BackgroundImage="ig_menuSep.gif" CssClass="SeparatorClass" CustomRules="background-repeat:repeat-x; " /> <ExpandEffects ShadowColor="LightGray" /> <MenuClientSideEvents InitializeMenu="UltraWebMenu1_InitializeMenu" /> <Items> <ignav:Item Text="Top Item"> <Items> <ignav:Item Enabled="False" Text=""> </ignav:Item> <ignav:Item Text="Sub Menu Item"> <Items> <ignav:Item Text="Sub Menu Item"> </ignav:Item> </Items> </ignav:Item> <ignav:Item Text="Sub Menu Item"> </ignav:Item> <ignav:Item Hidden="True" Text="Sub Menu Item"> </ignav:Item> </Items> </ignav:Item> <ignav:Item Text="Top Item"> <Items> <ignav:Item Text="Sub Menu Item"> </ignav:Item> <ignav:Item Text="Sub Menu Item"> </ignav:Item> <ignav:Item Text="Sub Menu Item"> </ignav:Item> </Items> </ignav:Item> <ignav:Item Text="Top Item"> </ignav:Item> <ignav:Item Text="Top Item"> </ignav:Item> </Items> </ignav:UltraWebMenu> </div> <input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /> </form></body></html>
Here is a help link to the WebMenu CSOM:
http://help.infragistics.com/Help/NetAdvantage/NET/2007.3/CLR2.0/html/WebMenu_CSOM_Overview.html
I will enter a feature request on your behalf