This question is locked. New answers and comments are not allowed.
I was following the instructions here:
http://www.telerik.com/community/forums/aspnet-mvc/grid/custom-commands-in-grid.aspx
I took the suggestion with redirecting the select command by java script.
This works as long as I have not previously performed an action like add record or delete record. Then it does not work any more.
I am using Ajax binding.
Here is the view:
With firebug it seems like as if the scripts disappear. Do I have it at the wrong place?
http://www.telerik.com/community/forums/aspnet-mvc/grid/custom-commands-in-grid.aspx
I took the suggestion with redirecting the select command by java script.
This works as long as I have not previously performed an action like add record or delete record. Then it does not work any more.
I am using Ajax binding.
Here is the view:
| <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<List<RenderSprint>>" %> |
| <%@ Import Namespace="WorkstreamPlatform_WebRole.Controllers" %> |
| [<%= Html.ActionLink("Create New", "Create", "Sprint") %>] |
| <% |
| Html.Telerik().Grid<RenderSprint>() |
| .BindTo(Model) |
| .Name("SprintGrid") |
| .Localizable("de-DE") //ToDo Culture allgemein ersetzen |
| .ToolBar(tb => { |
| tb.Insert(); |
| tb.Custom().Action<SprintController>(sc => sc.Aggregate()).Text("Aggregate"); // ToDo hier muss ich Ajax machen. |
| }) |
| .DataBinding(b => b.Ajax() |
| .Select<SprintController>(sc => sc.AjaxGridSelect()) |
| //ToDo .Delete<SprintController>(sc => sc.AjaxGridDelete()) |
| .Delete("AjaxGridDelete", "Sprint") |
| .Insert<SprintController>(sc => sc.AjaxGridInsert()) |
| // ToDo .Update<SprintController>(sc => sc.AjaxGridUpdate())) |
| .Update("AjaxGridUpdate", "Sprint")) |
| .DataKeys(k => k.Add(s => s.RowKey)) |
| .Columns(c => |
| { |
| c.Command(s => |
| { |
| s.Delete(); |
| s.Edit(); |
| s.Select(); |
| }); |
| c.Bound(s => s.Title); |
| c.Bound(s => s.RemainingDays).Format("{0}").ReadOnly(true); |
| c.Bound(s => s.RemainingHours).Format("{0}").ReadOnly(true); |
| c.Bound(s => s.Date).Format("{0:d}"); |
| }) |
| .Sortable() |
| .Pageable() |
| .Render(); |
| %> |
| <% Html.Telerik().ScriptRegistrar().OnDocumentReady(() => { |
| %> |
| $('.t-grid-select').live('click', function (e) { |
| e.preventDefault(); |
| location.href = "/Sprint/Detail/" + e.target.pathname.substring(14,e.target.pathname.length); |
| }); |
| <% }); %> |
With firebug it seems like as if the scripts disappear. Do I have it at the wrong place?