Context Menu "Open in new tab" - Popup Blocker problem

3 posts, 0 answers
  1. richard
    richard avatar
    38 posts
    Member since:
    May 2011

    Posted 02 Jan 2012 Link to this post

    I am creating a radtreeview context menu with an item 'Open link in new tab'.

    I have created a context menu server side and assigned it to all nodes, but problem is I need to set the NavigateURL property of the context menu and this is different for every node.

    I tried using the OnClientContextMenuItemClicked and then tried using Window.Open in the javascript function:


    ContextMenuClicked(sender, args) {,


    This function get the value property of the treeview node where the URL is stored, but unfortuanetely this doesn't work because it is stopped by the IE popup blocker.

    I suppose I could create a unique context menu for every single node - but there might be hundreds of nodes and I worry this would make things slow.

    Please can you think of a way I can solve this problem?

    Many thanks for your help


  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 03 Jan 2012 Link to this post

    Hello Richard,

    You could use the following approach to handle your "Open In New Tab" context menu.

    function OnClientContextMenuShowing(sender, args) {
        var node = args.get_node();
        var menu = args.get_menu();
        // get "Open In New Tab" item and set the url to use
        var openInNewTabItem = menu.findItemByValue("OpenInNewTab");

    So pretty much, I handle the OnClientContextMenuShowing event of the RadTreeView and set the NavigateUrl of the "Open In New Tab" item to the NavigateUrl of the selected node. You just need to set the Target property of the "Open In New Tab" item to _blank and everything should work as expected.

    I hope that helps.
  3. DevCraft R3 2016 release webinar banner
  4. richard
    richard avatar
    38 posts
    Member since:
    May 2011

    Posted 03 Jan 2012 Link to this post

    Hello Kevin

    thanks for your reply.

    That really helped me.

    I had to make a couple of changes, as my url is inside the value property of the node, and I added the target = _blank to get my new tab opening.


    Thanks again
Back to Top