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
245
WebDataMenu eventArgs.set_cancel(true) not working properly
posted

Hi everybody, I'm working with the WebDataMenu for NetAdvantage 9.2 and I'm having an issue where the  eventArgs.set_cancel(true); is not working properly.

In my code, I do not want the WebDataMenu to post back when a specific item is clicked. 

 function OnItemClick(menu, eventArgs) {

var sPath = window.location.pathname;

 var MenuItemName = eventArgs.getItem().get_text();

    if ((sPath.endsWith('Home.aspx') == true) && (MenuItemName == "Home") ) {
                 eventArgs.set_cancel(true);
                              }

}

However, the code is not working correctly. What I find weird is that when I put alert statements in there, it works correctly.

 

 function OnItemClick(menu, eventArgs) {

var sPath = window.location.pathname;

 var MenuItemName = eventArgs.getItem().get_text();

    if ((sPath.endsWith('Home.aspx') == true) && (MenuItemName == "Home") ) {
                 eventArgs.set_cancel(true);

               alert("Does not go here");
                              }

}

Any help would be greatly appreciated.

 

Thanks

 

  • 3726
    Suggested Answer
    posted

    Hi,

    There was an issue with canceling the ItemClick event. Please upgrade to the latest service release for 9.2 build 2131 released around 7.July.2010. We have also added an AutoPostBack flags as an enhancement for the menu.

    Thanks,

    Lubomir