简体   繁体   中英

How open a new tab of link using kendo panel bar

I am using Kendo panel bar to make a menu. Here I encountered a requirement: enable to open a new tab using panel bar. I found that the router link in the panel bar cannot support my requirement. Does anybody have good solution? Many thanks.

This is very crude as far as looking for something to key off for child elements only but it works. Might something like this work for you? Your question is a little vague, I am assuming you want the ability to open a page in a new tab.

This is for jQuery, just noticed you were looking for angular.

See in JS Fiddle

// event handler for select
var onSelect = function(e) {
    // access the selected item via e.item (HTMLElement)
    if (!$(e.item).attr("aria-expanded")) {
        //Child elements only
        window.open("http://www.google.com", "_blank");
    }
};

// attach select event handler via bind()
$("#panelbar").data("kendoPanelBar").bind("select", onSelect);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM