or
@(Html.Kendo()
.Grid<
ShowResumo
>()
.Name("grid")
.Columns(columns => {
columns.Bound(e => e.MasterId).Hidden(true);
columns.Bound(e => e.Code).Width(110);
columns.Bound(e => e.Description).Width(110);
columns.Bound(e => e.Date).Width(110);
columns.Bound(e => e.Quantity).Width(110);
columns.Bound(e => e.Type);
})
.Sortable()
.Pageable()
.Scrollable()
.ClientDetailTemplateId("template")
.HtmlAttributes(new { style = "height:430px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(6)
.Read(read => read.Action("ListResumo", "Transportador"))
)
.Events(events => events.DataBound("dataBound"))
)
<
script
id
=
"template"
type
=
"text/kendo-tmpl"
>
@(Html.Kendo()
.Grid<
ShowDetails
>()
.Name("grid_#=MasterId#")
.Columns(columns => {
columns.Bound(o => o.TransportId).Width(70);
columns.Bound(o => o.TruckId).Width(110);
columns.Bound(o => o.Driver);
columns.Bound(o => o.Plate).Width(200);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(5)
.Read(read => read.Action("ListDetails", "Transportador", new { masterId= "#=MasterId#" }))
)
.Pageable()
.Sortable()
.ToClientTemplate()
)
</
script
>
<
script
>
function dataBound() {
this.expandRow(this.tbody.find("tr.k-master-row").first());
}
</
script
>
Unhandled exception at line 9, column 6594 in http://localhost:60455/Scripts/kendo/2013.1.319/kendo.all.min.js
0x800a139e - Microsoft JScript runtime error: Invalid template:'
<div class="k-widget k-grid" id="grid_#=MasterId#"><table cellspacing="0">
Uncaught Error: Invalid template:' <
div
class
=
"k-widget k-grid"
id
=
"grid_#=MasterId#"
>
public class ShrinkCoeffModel
{
[Display(Name = "thickness")]
public virtual int Thickness { get; set; }
[Display(Name = "wett")]
public virtual string[] Wetness { get; set; }
[Display(Name = "coeff")]
public virtual decimal[] Coeff { get; set; }
}
@(
Html.Kendo().Grid(Model)
.Name("ShrinkCoeff")
.ToolBar(commands =>
{
commands.Create();
})
.Columns(columns =>
{
columns.Bound(o => o.Thickness);
for (int i = 0; i <
Model.FirstOrDefault
().Wetness.Count(); i++)
{
columns.Bound(o => o.Wetness[i]);
}
columns.Command(command =>
{
command.Edit();
command.Destroy();
}).Width(210).Title("Действия");
})
.Editable(editable => editable.TemplateName("Item").Mode(GridEditMode.PopUp))
.DataSource(dataBinding => dataBinding
.Server()
.Model(model => model.Id(o => o.Thickness))
.Update("Edit", "ShrinkCoeff")
.Create("Create", "ShrinkCoeff")
.Destroy("Delete", "ShrinkCoeff"))
.Pageable()
.Sortable()
.Selectable()
)
for (int i = 0; i <
Model.FirstOrDefault
().Wetness.Count(); i++)
{
columns.Bound(o => o.Wetness[i]);
}
@(Html.Kendo()
.Grid<
Copper.Domain.Entities.EntInventory
>()
.Name("_gridCellInventory")
.Columns(columns =>
{
columns.Bound(c => c.DeviceName);
columns.Command(cmd => cmd.Edit());
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.Scrollable()
.DataSource(datasource => datasource
.Ajax()
.PageSize(20)
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(c => c.InventorySeq))
.Read(read => read.Action("GetCellInventory", "CellInventory").Data("_gridCellInventoryParameters"))
.Update(update => update.Action("UpdateCellInventory", "CellInventory"))
)
)
[AcceptVerbs(HttpVerbs.Post)]
public
ActionResult UpdateCellInventory([DataSourceRequest] DataSourceRequest request, EntInventory inventory)
{
if
(inventory !=
null
&& ModelState.IsValid)
{
_margoRepository.UpdateInventory(inventory);
}
return
Json(ModelState.ToDataSourceResult());
}