Target Blanck

2 posts, 0 answers
  1. UBALDI SI
    UBALDI SI avatar
    4 posts
    Member since:
    Jul 2013

    Posted 11 Sep Link to this post

    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"));
            })

  2. Neli
    Admin
    Neli avatar
    59 posts

    Posted 12 Sep Link to this post

    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.
Back to Top