Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
5368
WebDataMenu CSOM addItem
posted

While looking through the 10.3 documentation for the WebDataMenu, I noticed a new function called addItem, which is listed here:

http://help.infragistics.com/NetAdvantage/ASPNET/Current/CLR4.0/?page=WebDataMenu~Infragistics.Web.UI.WebDataMenu~addItem.html

This feature wasn't documented in any of the release notes, and I can't find any sample code, so I am trying to figure out how to use it using the debugger.

Here is what I have observed so far:

  • I am having trouble gaining a reference to the item after it is added, so that I can adjust the navigation URL, etc.
    • If I define a variable and set to equal the result of the addItem operation, the variable is still "undefined" after the item is added.  This seems to contradict the usage displayed in the documentation
    • Even though the item may be displayed on the screen, the Items collection of the parent doesn't seem to contain the new item.
  • The menu height is not adjusted after the item is added, so the item may be obscured by the menu boundary.
  • If I add the item inside of a webdatagrid client event, as shown here, the WebDataMenu actually initiates an AJAX call to the page which fails.  I have no idea what it is trying to do, or why communication with the server would be necessary

Can someone at Infragistics please provide some sliver of sample code that I can use to accomplish the following on the client:

  • In the ItemHovered event, if the item has no child nodes,
    • add a few sample child items,
    • set the navigation URL on each item 
    • and expand.

Pretty please with cherries and a Star Wars action figure on top?

Also, the presence of the AJAX call indicates that maybe there is a way to do AJAX load-on-demand of submenu items.  That is actually preferable to what I was going to do using a WebService.  If you have any documentation on that, I'd be in your debt as well!

Parents Reply Children