This question is locked. New answers and comments are not allowed.
I have this
and this:
This works. However between the Ajax Request and the success response I would like to make the grid spinner spin, so that the user knows, that something is still going on. The controller action typically takes about 30 seconds.
| 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.AjaxAggregate()) |
| .Text("Aggregate") |
| .HtmlAttributes(new {id="custom-action-aggregate"}); |
| }) |
| .DataBinding(b => b.Ajax() |
| .Select<SprintController>(sc => sc.AjaxGridSelect()) |
| .Delete<SprintController>(sc => sc.AjaxGridDelete(String.Empty)) // Parameter is added by Grid engine |
| .Insert<SprintController>(sc => sc.AjaxGridInsert()) |
| .Update<SprintController>(sc => sc.AjaxGridUpdate(String.Empty))) // Parameter is added by Grid engine |
| .DataKeys(k => k.Add(s => s.RowKey)) |
| .Columns(c => |
| { |
| c.Command(s => |
| { |
| s.Select(); // .HtmlAttributes(new {style = "width: 80%; height: 80%" }); |
| s.Edit(); // .HtmlAttributes(new { style = "width: 80%; height: 80%" }); |
| s.Delete(); //.HtmlAttributes(new { style = "width: 80%; height: 80%" }); |
| }).Width(300); |
| c.Bound(s => s.Title); |
| c.Bound(s => s.RemainingDays).Format("{0}").ReadOnly(true).Width(15).Title("Rem. Days"); |
| c.Bound(s => s.RemainingHours).Format("{0}").ReadOnly(true).Width(15).Title("Rem. Hours"); |
| c.Bound(s => s.Date).Format("{0:d}"); |
| }) |
| .Sortable() |
| .Pageable() |
| .Render(); |
and this:
| $("#custom-action-aggregate").live('click', function (e) { |
| e.preventDefault(); |
| var grid = $("#SprintGrid").data("tGrid"); |
| var target = e.target.href; |
| $.ajax({ |
| url: target, |
| contentType: 'application/json; charset=utf-8', |
| type: 'POST', |
| dataType: 'json', |
| error: function (xhr, status) { |
| alert(status); |
| }, |
| success: function (result) { |
| var grid = $("#SprintGrid").data("tGrid"); |
| grid.ajaxRequest(); |
| } |
| }); |
This works. However between the Ajax Request and the success response I would like to make the grid spinner spin, so that the user knows, that something is still going on. The controller action typically takes about 30 seconds.