I would like to be able to attach custom attributes to each WebDataMenu item, so that I can respond to clicks via the CSOM and avoid a page postback to get the data.
In this example, I am using the WebDataMenu to select an inventory part, and would like to avoid the postback needed to obtain the default quantity and the price. If these could be added as attributes to the WebDataMenu item, I would have everything I need right inside the client-side event.
I am not using binding, but am instead creating each item programatically.
Hi robhudson2,
The text that actually appears on the data menu item is the Text property. There is another property, called Value, that simply stores information. It is available on the client as menuItem.get_value(). Simply put your extra information in there. If you have multiple things, you could delimit the string with '|' or something else.
regards,David Young
Hi,
Trying to get my DataMenuItem Value, but it doesn't work. It doesn't even appear in the Javascript Intellisense, although get_text() function is in the intellisense dropdown.
I'm using 12.1.20121.1005 NetAdvantage
function ContactActionMenu_Clicked(menu, e) {
alert($IG.WebDataMenu.find(menu.get_id()).get_selectedItem().get_value());
}
That is a good workaround. Thank you very much!