This is a migrated thread and some comments may be shown as answers.

Target Blanck

1 Answer 282 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
UBALDI SI
Top achievements
Rank 1
UBALDI SI asked on 11 Sep 2017, 02:32 PM

Hello,

I'm looking for add a target blank to an url but i wonder how to do it:

        @(Html.Kendo().TreeView()
        .Name("treeview-right")
        .DragAndDrop(true)
        .Items(treeview =>
        {

            treeview.Add().Text("Accès Mirakl")
                          .Url("http://google.com")
                          .ImageUrl(Url.Content("~/Content/images/internet_16x16.png"));

            treeview.Add().Text("Wiki Mirakl")
                          .Url("http://goole.fr")
                          .ImageUrl(Url.Content("~/Content/images/ampoule_16x16.png"));
        })

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 12 Sep 2017, 12:30 PM
Hi,

The desired behavior could be achieved by using Jquery attr method, to add the target attribute.

In the script below, on document ready function, all elements with link are extracted by class and their target attribute is set to '_blank'. 
<script>
$(document).ready(function () {
var links = $("a.k-link.k-in").attr("target", "_blank");
});
</script>

I hope that the Dojo example will help.


Regards,
Neli
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
TreeView
Asked by
UBALDI SI
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or