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

Aggregate error: Object doesn't support property or method [count]

3 Answers 64 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Szymon
Top achievements
Rank 1
Szymon asked on 22 Nov 2012, 01:46 PM
Here is my razor code:
Html.Kendo().Grid<KendoDemoMvc.Models.Issue>()
       .Name("Issues")
       .DataSource(ds => ds.Ajax().ServerOperation(false)
           .Read("Issues", "Home")
           .PageSize(5)
           .Aggregates(aggr =>
           {
               aggr.Add(o => o.Value).Count();
           })
       )
       .Columns(col =>
           {
 
               col.Bound(x => x.Id);
               col.Bound(x => x.Name);
               col.Bound(x => x.Value)
                  .ClientGroupHeaderTemplate("(Total: #=count#)")
           ;
           })
        .Groupable()
       .Selectable()
       .Pageable()
       .Render()
       ;
and controller action

public ActionResult Issues([DataSourceRequest]DataSourceRequest request)
{
    DataSourceResult result = GetIssues().ToDataSourceResult(request);
 
    return Json(result);
}

I try to group by column Name on UI, but it throws me runtime js error:  Object doesn't support property or method [count]
Please help...

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 26 Nov 2012, 12:56 PM
Hello Szymon,

I'm afraid that I'm not sure what may caused the error you have described, judging from the provided details. Could you please provide a small run-able sample in which this behavior can be observed locally?

Greetings,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Szymon
Top achievements
Rank 1
answered on 26 Nov 2012, 01:15 PM
0
Rosen
Telerik team
answered on 26 Nov 2012, 02:03 PM
Hello Szymon,

Thanks for the sample. The error you are getting is already fixed. Please upgrade to the latest version of KendoUI.

All the best,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Szymon
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Szymon
Top achievements
Rank 1
Share this question
or