2014-01-22 64 views
3

我正在使用Kendo UI Grid.And我想對InCell進行編輯.InCell編輯工作正常。一旦我點擊「Add New Record」按鈕,然後它顯示第一列「名稱」的文本框。Tab順序在Cell編輯中不起作用Kendo UI Grid

我的問題是當我把值放在「名稱」字段後按標籤,然後它沒有轉移到第二個字段「說明」。並且標籤順序應該在那裏工作。

下面是劍道網格的代碼段: -

@using Gts.GlaspacLX.Web.App_Start; 
@using Gts.GlaspacLX.ListValues; 
@using System.Collections; 
@using Kendo.Mvc.UI 

@ @

.K髒{顯示:無; }

<fieldset> 
    <form>   
     <div id="divProduct" style="display: none;"> 


@(Html.Kendo().Grid<Gts.GlaspacLX.Web.ViewModel.ProductViewModel>() 
    .Name("ProductGrid") 
    .Columns(columns => { 
     columns.Bound(p => p.Name).Width(50); 
     columns.Bound(p => p.Description).Width(200);              
     columns.Command(command => { command.Destroy(); }).Width(75); 
     columns.Bound(p => p.ID).Hidden(); 
    }) 
    .ToolBar(commands => { 
     commands.Create(); 
     commands.Save(); 
    }) 
    .Editable(editable => editable.Mode(GridEditMode.InCell)) 
    .DataSource(dataSource => dataSource 
     .Ajax() 
     .Batch(true) 
     .ServerOperation(false) 
     .Model(model => { 
      model.Id(p => p.ID); 
     })           
     .Read(read => read.Action("ProductEditingInline_Read", "Product")) 
     .Create(create => create.Action("ProductEditingInline_Create", "Product")) 
     .Update(update => update.Action("ProductEditingInline_Update", "Product")) 
     .Destroy(destroy => destroy.Action("ProductEditingInline_Destroy", "Product") 
     ) 
     .Events(events => events.Change("onProductChange")) 
     // .Events(events => events.Error("error_handler")) 
    ) 
) 


      <input type="button" value="Cancel" onclick=" $('.k-button.k-button-icontext.k-grid-cancel-changes').click(); $('#productWindow').data('kendoWindow').close(); " /> 
      <input type="button" value="Save" onclick=" SaveProductChanges(); " /> 
     </div> 
    </form> 
</fieldset> 
} 

任何人都可以幫我解決這個問題嗎?

+0

爲什麼你的網格包裹在'fieldset'內的'form'內? – dcodesmith

回答

3

你會想要使用網格的navigatable option。以下是我構建的jsfiddle示例:Kendo Grid Example with keyboard navigation。在MVC是導航選項由柵格上調用.Navigatable()打開(見下面的例子):

@(Html.Kendo().Grid<TestModel>() 
.Name("TestGrid") 
.Columns(columns => 
{ 
    columns.Bind(c => c.DisabledString); 
    columns.Bind(c => c.Description); 
    columns.Bind(c => c.TestInvisibleDate); 
    columns.Bind(c => c.TestDate); 
    columns.Bind(c => c.AllExpressions); 
}) 
.HtmlAttributes(new { style = "height:550px;" }) 
.Editable(editable => editable.Mode(GridEditMode.InCell)) 
.Sortable() 
.Scrollable(s => { s.Enabled(true); s.Virtual(true); }) 
.Pageable(p => p.Enabled(false)) 
.Mobile(MobileMode.Disabled) 
.Navigatable() 
.Resizable(s => s.Columns(true)) 
.Reorderable(c => c.Columns(true)) 
.DataSource(dataSource => dataSource 
    .Ajax() 
    .Batch(true) 
    .PageSize(50) 
    .ServerOperation(false) 
    .Model(model => 
    { 
     model.Id(e => e.UniqueId); 
    }) 
    ) 
) 

幫助呢?