Hi, I am having a problem with the groupping of the telerik grid, in firefox is working, in IE8 is infinity loading, and it trows the error:
Line: 8
Error: 'aggregates' is null or not an object
'length' is null or not an object
@( Html.Kendo().Grid(Model)
.Name("Grid")
.ClientDetailTemplateId("inventoryTemplate")
.DataSource(ds => ds.Ajax()
//TODO: Problem in here
.Group(g => g.Add(c => c.GradeCode))
.PageSize(50)
.Sort(sort => {
sort.Add(p => p.SizeThick).Ascending();
sort.Add(p => p.SizeLength).Ascending();
sort.Add(p => p.SizeWidth).Ascending();
})
//.Aggregates(aggregates =>
//{
// aggregates.Add(x => x.GradeID);
//})
.Model(m =>
{
m.Id(p => p.StockID);
m.Field(p => p.QuantityToEnquiry).DefaultValue(1);
})
.Read(r => r.Action("Read", "Home"))
)
.ToolBar(toolBar =>
toolBar.Custom()
.HtmlAttributes(new { id = "sendEnquiry" })
.Text("Send Enquiry")
)
.ToolBar(toolBar =>
toolBar.Custom()
.HtmlAttributes(new { id = "clearFilter" })
.Text("Reset Filters")
)
.ToolBar(toolBar =>
toolBar.Custom()
.Text("Export To Excel")
.HtmlAttributes(new { id = "export" })
.Url(Url.Action("Export", "Home", new { page = 1, pageSize = "~", filter = "~", sort = "~" }))
)
.Columns(columns =>
{
columns.Bound("Selected")//p => p.Selected)
.Sortable(false)
.Filterable(false)
.ClientTemplate(
"<input type='hidden' name='list.Index' value='#=StockID#'/>" +
"<input type='checkbox' id='list_#=StockID#__Selected' name='list[#=StockID#].Selected' value='false'/>"
).Width(5);
columns.Bound(p => p.GradeCode).Width(10)
.Filterable(false).Sortable(false).HeaderTemplate(@<text>
@(Html.Kendo().ComboBox()
.DataValueField("GradeCode")
.Placeholder("Grade Code")
.DataTextField("GradeCode")
.Name("GradeCode")
.DataSource(ds => ds.Read(rea => rea.Action("GetGradeCodeList", "Home")))
.Events(ev => ev.Change("onComboGradeCodeChange"))
)
</text>)
.ClientGroupHeaderTemplate("<b class='header-title'>Grade Code</b>: <label class='header-value'>" + "#=value# </label>");
columns.Bound(p => p.SizeLength).HeaderHtmlAttributes(
new { @class = "filter-class" }
).Width(10).Filterable(true);
columns.Bound(p => p.SizeWidth).Width(10);
columns.Bound(p => p.SizeThick).Width(10);
columns.Bound(p => p.Qty).Width(10);
columns.Bound(p => p.WeightKG).Width(15);
columns.Bound(p => p.LocationDescriptionShort)
.ClientTemplate("#=LocationDescriptionShort# ")
.Width(20).Filterable(false).Sortable(false).HeaderTemplate(@<text>
@(Html.Kendo().ComboBox()
.DataValueField("LocationDescriptionShort")
.Placeholder("Location")
.DataTextField("LocationDescriptionShort")
.Name("LocationDescriptionShort")
.DataSource(ds => ds.Read(rea => rea.Action("GetLocationList", "Home")))
.Events(ev => ev.Change("onComboLocationChange"))
)
</text>);
columns.Bound(p => p.Opco).Filterable(false).Sortable(false).HeaderTemplate(@<text>
@(Html.Kendo().ComboBox()
.DataValueField("Opco")
.Placeholder("Company")
.DataTextField("Opco")
.Name("Opco")
.DataSource(ds => ds.Read(rea => rea.Action("GetCompanyList", "Home")))
.Events(ev => ev.Change("onComboCompanyChange"))
)
</text>);
columns.Bound("QuantityToEnquiry").Filterable(false).Sortable(false)
.ClientTemplate("<input class='qtyToEnquiry' type='text' value='1' />");
})
.Events(ev => { ev.DataBound("onDataBound"); })
.Pageable()
.Sortable(s => s.SortMode(GridSortMode.MultipleColumn))
)
<script id="inventoryTemplate" type="text/kendo-tmpl">
@(Html.Kendo().TabStrip()
.Name("TabStrip_#=StockID#")
.SelectedIndex(0)
.Items(items =>
{
items.Add()
.Text("Details")
.Content(
"<div class='inventory-details'>" +
"<ul>" +
"<li><label>Full Grade: </label>#= GradeDescription #</li>" +
"<li><label>Stock Reference: </label>#= StockRef #</li>" +
"<li><label>Cut/Mill Edge: </label>#= MillEdges #</li>" +
"</ul>" +
"<ul>" +
"<li><label>Memo: </label>#= OtherDetails #</li>" +
"<li><label>Vessel: </label>#= Vessel #</li>" +
"<li><label>Producer: </label>#= Producer #</li>" +
"<li><label>Detailed Location: </label>#= LocationDescription #</li>" +
"</ul>" +
"</div>"
);
})
.ToClientTemplate())
</script>
Line: 8
Error: 'aggregates' is null or not an object
'length' is null or not an object
@( Html.Kendo().Grid(Model)
.Name("Grid")
.ClientDetailTemplateId("inventoryTemplate")
.DataSource(ds => ds.Ajax()
//TODO: Problem in here
.Group(g => g.Add(c => c.GradeCode))
.PageSize(50)
.Sort(sort => {
sort.Add(p => p.SizeThick).Ascending();
sort.Add(p => p.SizeLength).Ascending();
sort.Add(p => p.SizeWidth).Ascending();
})
//.Aggregates(aggregates =>
//{
// aggregates.Add(x => x.GradeID);
//})
.Model(m =>
{
m.Id(p => p.StockID);
m.Field(p => p.QuantityToEnquiry).DefaultValue(1);
})
.Read(r => r.Action("Read", "Home"))
)
.ToolBar(toolBar =>
toolBar.Custom()
.HtmlAttributes(new { id = "sendEnquiry" })
.Text("Send Enquiry")
)
.ToolBar(toolBar =>
toolBar.Custom()
.HtmlAttributes(new { id = "clearFilter" })
.Text("Reset Filters")
)
.ToolBar(toolBar =>
toolBar.Custom()
.Text("Export To Excel")
.HtmlAttributes(new { id = "export" })
.Url(Url.Action("Export", "Home", new { page = 1, pageSize = "~", filter = "~", sort = "~" }))
)
.Columns(columns =>
{
columns.Bound("Selected")//p => p.Selected)
.Sortable(false)
.Filterable(false)
.ClientTemplate(
"<input type='hidden' name='list.Index' value='#=StockID#'/>" +
"<input type='checkbox' id='list_#=StockID#__Selected' name='list[#=StockID#].Selected' value='false'/>"
).Width(5);
columns.Bound(p => p.GradeCode).Width(10)
.Filterable(false).Sortable(false).HeaderTemplate(@<text>
@(Html.Kendo().ComboBox()
.DataValueField("GradeCode")
.Placeholder("Grade Code")
.DataTextField("GradeCode")
.Name("GradeCode")
.DataSource(ds => ds.Read(rea => rea.Action("GetGradeCodeList", "Home")))
.Events(ev => ev.Change("onComboGradeCodeChange"))
)
</text>)
.ClientGroupHeaderTemplate("<b class='header-title'>Grade Code</b>: <label class='header-value'>" + "#=value# </label>");
columns.Bound(p => p.SizeLength).HeaderHtmlAttributes(
new { @class = "filter-class" }
).Width(10).Filterable(true);
columns.Bound(p => p.SizeWidth).Width(10);
columns.Bound(p => p.SizeThick).Width(10);
columns.Bound(p => p.Qty).Width(10);
columns.Bound(p => p.WeightKG).Width(15);
columns.Bound(p => p.LocationDescriptionShort)
.ClientTemplate("#=LocationDescriptionShort# ")
.Width(20).Filterable(false).Sortable(false).HeaderTemplate(@<text>
@(Html.Kendo().ComboBox()
.DataValueField("LocationDescriptionShort")
.Placeholder("Location")
.DataTextField("LocationDescriptionShort")
.Name("LocationDescriptionShort")
.DataSource(ds => ds.Read(rea => rea.Action("GetLocationList", "Home")))
.Events(ev => ev.Change("onComboLocationChange"))
)
</text>);
columns.Bound(p => p.Opco).Filterable(false).Sortable(false).HeaderTemplate(@<text>
@(Html.Kendo().ComboBox()
.DataValueField("Opco")
.Placeholder("Company")
.DataTextField("Opco")
.Name("Opco")
.DataSource(ds => ds.Read(rea => rea.Action("GetCompanyList", "Home")))
.Events(ev => ev.Change("onComboCompanyChange"))
)
</text>);
columns.Bound("QuantityToEnquiry").Filterable(false).Sortable(false)
.ClientTemplate("<input class='qtyToEnquiry' type='text' value='1' />");
})
.Events(ev => { ev.DataBound("onDataBound"); })
.Pageable()
.Sortable(s => s.SortMode(GridSortMode.MultipleColumn))
)
<script id="inventoryTemplate" type="text/kendo-tmpl">
@(Html.Kendo().TabStrip()
.Name("TabStrip_#=StockID#")
.SelectedIndex(0)
.Items(items =>
{
items.Add()
.Text("Details")
.Content(
"<div class='inventory-details'>" +
"<ul>" +
"<li><label>Full Grade: </label>#= GradeDescription #</li>" +
"<li><label>Stock Reference: </label>#= StockRef #</li>" +
"<li><label>Cut/Mill Edge: </label>#= MillEdges #</li>" +
"</ul>" +
"<ul>" +
"<li><label>Memo: </label>#= OtherDetails #</li>" +
"<li><label>Vessel: </label>#= Vessel #</li>" +
"<li><label>Producer: </label>#= Producer #</li>" +
"<li><label>Detailed Location: </label>#= LocationDescription #</li>" +
"</ul>" +
"</div>"
);
})
.ToClientTemplate())
</script>