or
window.onload =
function
() {
$(
"#vertical"
).css(
"height"
, $(window).height());
};
columns.Bound(n => n.IsEnabled)
.Width(100)
.ClientTemplate(
"# if (IsEnabled) { #" + "Yes" +
"# } else { #" + "No" + "#}#");
<
script
type
=
"text/x-kendo-tmpl"
id
=
"template"
>
<
div
class
=
"product"
>
<
img
src
=
"@Url.Content("
/")${ImagePath}.jpg"
alt
=
"${Name} image"
/>
<
h3
>${Name}</
h3
>
<
dl
>
<
dt
>Price:</
dt
>
<
dd
>${kendo.toString(Price, "c")}</
dd
>
<
dt
><
input
type
=
"button"
value
=
"Remove"
/></
dt
>
</
dl
>
</
div
>
<
div
>
<
h3
>Total price: ?????</
h3
>
</
div
>
</
script
>
@(Html.Kendo().ListView<
SixthCoffee.Web.ViewModels.CartItem
>()
.Name("CartList")
.TagName("div")
.ClientTemplateId("template")
.DataSource(dataSource => {
dataSource.Read(read => read.Action("AjaxCartGrid_Read", "MenuSurface"));
dataSource.Aggregates(aggregates =>
{
aggregates.Add(s => s.TotalPrice).Sum();
});
})
)
l._current.closest("table")[0].focus()
Unhandled exception at line 16, column 31418 in http://localhost/zzz/Scripts/kendo/2012.3.1114/kendo.web.min.js@(Html.Kendo().Grid<MyNamespace.MyModel>() .Name("myGrid") .Columns(columns => { columns.Bound(c => c.Name); columns.Command(c => {
c.Edit();
c.Destroy(); }); }) .ToolBar(toolbar => { toolbar.Create(); }) .Sortable() .Selectable() .Reorderable(r => r.Columns(true)) .Resizable(r => r.Columns(true)) .Navigatable() .Filterable() .Scrollable(scroll => scroll.Height(500)) .Editable(editable => editable.Mode(GridEditMode.InLine)) .DataSource(dataSource => dataSource .Ajax() .Read(read => read .Type(HttpVerbs.Get) .Url(Url.RouteUrl("DefaultApi", new { httproute = "", controller = "mycontroller" })) ) .Create(create => create .Type(HttpVerbs.Post) .Url(Url.RouteUrl("DefaultApi", new { httproute = "", controller = "mycontroller" })) ) .Update(update => update .Type(HttpVerbs.Put) .Url(Url.RouteUrl("DefaultApi", new { httproute = "", controller = "mycontroller" })) ) .Destroy(destroy => destroy .Type(HttpVerbs.Delete) .Url(Url.RouteUrl("DefaultApi", new { httproute = "", controller = "mycontroller" })) ) .Model(m => { m.Id(c => c.Id); } ) .ServerOperation(false)) )
UPDATE: Since it was apparently just trying to find a row to focus, I added a check to see if the object was null. I wrapped
the call like this.
function(){if(l._current)l._current.closest("table")[0].focus();}
Seems to be working now for both a single row on the grid or multiple rows. Hope this gets fixed in a future release.