Problem executing an action on custom command click

2 posts, 0 answers
  1. Michele
    Michele avatar
    426 posts
    Member since:
    Jun 2009

    Posted 25 Sep 2014 Link to this post

    I've a grid defined as 
            .Columns(columns =>
                columns.Bound(c => c.Protocol).Title(ResourceStrings.Protocol);
                columns.Bound(c => c.Date).ClientTemplate(@DateTimeHtmlHelper.GetParsedDate("Date")).Title(ResourceStrings.Date);
                columns.Bound(c => c.CodiceRapporto).Title(ResourceStrings.CodeDossier);
                columns.Bound(c => c.Type).Title(ResourceStrings.Type);
                columns.Command(commadnAction => commadnAction.Custom("download").Text("Download").Click("Download"));
            .Resizable(resize => resize.Columns(true))
            .Scrollable(scr => scr.Enabled(true))
             .DataSource(dataSource => dataSource
            .ToolBar(toolbar =>
                    <div class="toolbar">
                        <label>Data da </label>
                        <label> Data a </label>
                        @Html.Kendo().Button().Name("btnCarica").Content(ResourceStrings.BtnLoadData).Events(events => { events.Click("LoadData"); })

        function Download(e) {
            var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
        var content ="@Html.ActionLink("CommunicationsReport", "Reports", new { protocol = 123 })"

    I wish at column click to load open a new page for downloading a pdf....

    in other parts of the project I've used something as

    var content ="@Html.ActionLink("CommunicationsReport", "Reports", new { protocol = 123 })"

    but now I can't since I don't have the link client side.... is there any simple way of doing that?

  2. Dimiter Madjarov
    Dimiter Madjarov avatar
    2310 posts

    Posted 26 Sep 2014 Link to this post

    Hi Paolo,

    A sample approach would be to use window.location.href to navigate to the new page.
    window.location.href = "/Reports/" + dataItem.protocol;

    Dimiter Madjarov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top