2014-01-24 35 views
1

我們正在嘗試使用聯機編輯模式創建Kendo Grid的所有區域。編輯字段選項卡更改爲不移動到下一個控件時,我們正面臨問題。kendo grid MVVM在更新現場數據後發生內聯編輯焦點問題

步驟重複問題:

  1. 編輯文本中第一個單元格
  2. 點擊tab鍵
  3. 從電網失去焦點。

請幫忙解決。

http://jsfiddle.net/suniltvl/eUhP5/

JS:

var vm = kendo.observable({ 

    roles: [{ 
     firstname: "test", 
     lastname: "test", 
     username: "test", 
    }, { 
     firstname: "test1", 
     lastname: "test1", 
     username: "test1", 
    }, { 
     firstname: "test2", 
     lastname: "test2", 
     username: "test2", 
    }] 

}); 

kendo.bind($("#people"), vm); 

HTML

<div id="people"> 
    <div data-role="grid" data-bind="source: roles" data-row-template="role-template" data-columns='[{"field": "firstName", "title": "First Name"}, 
         {"field": "lastName", "title": "Last Name"}, 
{"field": "username", "title": "user name"}]'></div> 
</div> 
<script type="text/x-kendo-template" id="role-template"> 
    < tr class = "k-grid-edit-row" > <td> < input type = "text" 
    class = "k-textbox" 
    data - bind = "value:firstname"/> < /td> 
    <td> 
     <input type="text" class="k-textbox" data-bind="value:lastname"/ > < /td> 
    <td> 
     <input type="text" class="k-textbox" data-bind="value:username"/ > < /td> 

    </tr > 

回答

0

劍道電網的navigatable財產開啓電網的鍵盤導航。我的Grid Jsfiddle演示使用此屬性。通常,當你定義一個網格時,它將每個單元格定義爲僅顯示元素,而當用戶在該單元格上單擊/單擊時,Kendo將動態顯示輸入元素。

var grid = $("#grid").kendoGrid({ 
    dataSource: ds, 
    navigatable: true, 
    pageable: true, 
    sortable: true, 
    resizable: true, 
    reorderable: true, 
    editable: true, 
    columns: [{ 
     field: "FirstName", 
     width: 90, 
     title: "First Name" 
    }, { 
     field: "LastName", 
     width: 200, 
     title: "Last Name" 
    }, { 
     field: "City", 
     width: 200 
    }] 
}).data("kendoGrid");