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 item custom attributes?
posted

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.

Parents
  • 33839
    Verified Answer
    posted

    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

Reply Children
No Data