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
550
WebDataMenu Selected Item(oItem.Key) is giving "undefined"
posted

Hi,

i m using WebDataMenu when binding some images to DataMenuItem when i click on DataMenuItem where  Key="Add" it is firing below mentioned java script code but oItem.Key is giving undefined. how to get the oItem.Key value in the below javascript code ?

<ig:WebDataMenu ID="WDM" height="22px" itemspacing="0" itemwidthdefault="25px" tabindex="0"
runat="server"  
OnItemClick="WDM_ItemClick" Width="100%">
<AutoPostBackFlags ItemClick="On" />
<GroupSettings Orientation="Horizontal" />
<ClientEvents ItemClick="WDMEditToolbarButtonClicked" />
<ItemSettings CssClass="ItemCssClass" SelectedCssClass="ItemSelectedCSS" HoverCssClass="ItemHoverCSS" />

<Items>
<ig:DataMenuItem ImageUrl=".new.gif" Key="Add"></ig:DataMenuItem>
<ig:DataMenuItem ImageUrl="edit.gif"  Key="Edit"></ig:DataMenuItem>
<ig:DataMenuItem ImageUrl="copy.gif"  Key="Copy"></ig:DataMenuItem>
<ig:DataMenuItem ImageUrl="delete.gif" Key="Delete"></ig:DataMenuItem>
</Items>

</ig:WebDataMenu>

JavaScript Code:-

function WDMEditToolbarButtonClicked(oToolBar, oItem, oEvent)
{
    if(oItem.Key == "Add")

     {
            alert(oItem.Key);
      }

}