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);
      }

}

Parents
No Data
Reply
  • 15320
    Verified Answer
    Offline posted

    Hello Ravi,

    Thank you for contacting Infragistics community.

    What version of IG controls are you using, because the event parameters of ItemClick client-side event that you're defining are not available in the new WebDateMenu control's ItemClick event. The WebDataMenu's ItemClick event accepts only two parameters: sender and event arguments. I'm attaching a sample with similar scenario for your reference. If you have further questions, please let me know.

    Regards,

    Tsanna

    wdmOnItemClick.zip
Children