剑道版动态模型字段绑定问题与剑道版本2013.3.1119

时间:2014-01-20 11:47:00

标签: kendo-ui kendo-grid model-binding

我使用了剑道版本2012.03.1114以及下面提到的代码来增加模型的价值并且工作正常但是当我将剑道代码更新到2013.3.1119时会出错

  

(TypeError:$(...)。data(...)。kendoGrid.editable is undefined)

请问任何解决方法吗?

var model = $('#grid').data().kendoGrid.editable.options.model;
model.set('Name', getNames());

@(Html.Kendo().Grid<ABC.Domain.Entities.user>() 
.Name("Grid") 
.Columns(columns => { 
columns.Command(command => { command.Edit(); }).Width(80); 
columns.Bound(u => u.Name).Title("Name").Width(150); 
columns.Bound(u => u.Status).Title("Status").Width(70); 
columns.Bound(u => u.Address).Title("Address").Width(100); }) 
.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("userEdit")) .Events(events => events.DataBound("onDataBound").Edit("onEdit")) 
.Pageable(paging => paging.PageSizes(new int[] { 5, 10, 20, 50 })
.Refresh(true)) 
.Sortable() .ToolBar(toolbar => toolbar.Create()) 
.Resizable(resize => resize.Columns(true)) 
.Scrollable() 
.DataSource(dataSource => dataSource .Ajax() .Model(model => { model.Id(p => p.userKey); }) .PageSize(5) .Events(events => events.Error("error_handler")) 
.Read(read => read.Action("user_Read", "User")) 
.Update(update => update.Action("User_Update", "User")) 
.Create(create => create.Action("User_Create", "User")) ) )

0 个答案:

没有答案