Telerik RadMenu: Cancel Postback if the item is the main menu

If you want to cancel the postback event on RadMenu when main menu is clicked, use following client side javascript function for ClientOnClick event.

function RadMenuClientOnClick(sender, args) {
    if (args.get_item().get_index() == 0 && args.get_item()._hasItems == true) {
        args.set_cancel(true);
    }
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s