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

Loader doesn't show

1 Answer 716 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hasse
Top achievements
Rank 1
Hasse asked on 29 Aug 2018, 08:13 AM

I load data to grid with ajax, the first time when getting data the loader doesn't show up, BUt when data is in grid and I press refresh, then the loader is showing. I have this problem on several grids in our solution. As I must do now is to force the loader, ugly solution: kendo.ui.progress($("#grid" + gridId), true);

 

Code:

 @(Html.Kendo().Grid<HP.PartnerPortal.Web.Areas.CustomerService.Models.PartnerViewModel>()
              .Name("gridPartners")
              .Columns(columns =>
              {
                  columns.Bound(c => c.InternalPartnerId)
                      .ClientTemplate(@"<a href='" + @Url.Content("~/CustomerService/Partner/") + "#:InternalPartnerId#/Start' class='g-color-darkblue-v2 g-color-darkblue-v2--hover'>#:InternalPartnerId#</a>")
                      .Title(Localizer.L("CustomerNumber")).Width(120);
                  columns.Bound(c => c.Id)
                      .ClientTemplate(@"<a href='" + @Url.Content("~/CustomerService/Partner/") + "#:InternalPartnerId#/Start' class='g-color-darkblue-v2 g-color-darkblue-v2--hover'>#:Title#</a>")
                      .Title(Localizer.L("Title"));
                  columns.Bound(c => c.Id)
                      .ClientTemplate(@"<a href='" + @Url.Content("~/CustomerService/Partner/") + "#:InternalPartnerId#/Start'>#:AbbreviatedTitle#</a>")
                      .Width(200)
                      .Title(Localizer.L("AbbreviatedTitle"));
                  columns.Bound(c => c.PartnerType).Title(Localizer.L("PartnerType")).Width(140);
                  columns.Bound(c => c.Market).Title(Localizer.L("Market")).Width(140);
                  columns.Bound(c => c.CurrentTime).Title(Localizer.L("Current Time")).Width(140);
              })
              .Scrollable(s => s.Height(667))
              .Events(events => events
                  .DataBinding("onPartnersGridDataBinding")
              )
              .Sortable()
              .Pageable(pageable => pageable
                  .Refresh(true)
                  .PageSizes(true)
                  .ButtonCount(5))
              .DataSource(dataSource => dataSource
                  .Ajax()
                  .PageSize(50)
                  .Read(read => read.Action("_ListBySearchFilter", "Partner", new { area = "CustomerService" }))
              )
              )

 

<script>
    function onPartnersGridDataBinding() {
        var grid = $("#gridPartners").data("kendoGrid");
        var count = grid.dataSource.total();
        $("#totalPartners").html(count);
    }
</script>

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 03 Sep 2018, 07:14 AM
Hello Hasse,

The configuration of the Grid is similar to the one in our online demos and there should be no reason for the missing loading indicator for the initial AJAX request:
You could inspect the browser`s console for any JavaScript errors that could be preventing the loading indicator to be shown initially. If there are no errors and the issue persists, you could try to upload a runnable project replicating it on a free upload service, so we can test and debug it locally.


Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Hasse
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or