如何重新排列KendoGrid Tab顺序?

时间:2012-11-21 18:27:07

标签: javascript asp.net-mvc-3 telerik grid kendo-ui

我正在使用KendoGrid并进行内联批量编辑。只有少数几列可以编辑。当按Tab键时,下一列被选中,但它不是下一个可编辑列。有没有办法控制KendoGrid中的Tab键顺序?如何使标签跳过不可编辑的列?

我的Mark-UP:

<div id="employeeGoalsGrid"></div>

我的Javascript:

var goalsDataSource = new kendo.data.DataSource({
        transport: {
            read: {
                url: '/MVC/ResearcherPoints/GetEmployeeResearchers',
                type: 'POST',
                contentType: 'application/json'
            },
            update: {
                url: '/MVC/ResearcherPoints/UpdateEmployeeGoal',
                type: 'POST',
                contentType: 'application/json'
                //dataType: "jsonp"
            },
            parameterMap: function (options, type) {
                debugger;
                $.extend(options, { ID: options.id });
                return JSON.stringify(options);
            }
        },
        batch: false,
        schema: {
            model: {
                id: 'ID',
                fields: {
                    id: { editable: false, nullable: false },
                    FirstName: { editable: false, nullable: true  },
                    LastName: { editable: false, nullable: true },
                    Title: { editable: false, nullable: true },
                    TeamName: { editable: false, nullable: true },
                    PointsGoal: { type: "number", nullable: true, validation: { required: false, min: 1 } }
                }
            }
        },
        sortable: true,
        filterable: true,
        columnMenu: true
    });


    $('#employeeGoalsGrid').kendoGrid({
        dataSource: goalsDataSource,
        navigatable: true,
        sortable: true,
        resizable: true,
        toolbar: ["save", "cancel"],
        columns: [
            { field: "FirstName", title: "First Name", width: 200},
            { field: "LastName", title: "Last Name", width: 200 },
            { field: "Title", title: "Title", width: 200 },
            { field: "TeamName", title: "Team", width: 200 },
            { field: "PointsGoal", title: "Goal", width: 200 }],
        editable: true,
        filterable: true,
    });

任何建议都将不胜感激。

2 个答案:

答案 0 :(得分:3)

要跳过单元格,您需要使用tabindex="99999"

我为测试目的创建了一个jsfiddle:http://jsfiddle.net/danieltulp/kfG7y/

我认为您需要查看使用属性:{tabindex:“999999”}

{ field: "UnitsInStock", title: "Units In Stock", width: 110,  attributes: { tabindex: "999999" } }

但这似乎不起作用。谁有更好的主意?

也许这是不可能的?

答案 1 :(得分:0)

您可以尝试将网格选项中的editable属性从true更改为"inline",并告诉我是否可以解决问题?我在this JSBin中创建了一个类似的方案,当我编辑一行时,标签顺序正常(OSX上的Chrome)。