【问题标题】:Kendo Grid - How to Arrow Keys to navigate over the rows?Kendo Grid - 如何使用箭头键导航行?
【发布时间】:2015-01-06 08:56:05
【问题描述】:

我想使用向上和向下箭头键来浏览 Kendo Grid 中的行。 向左和向右箭头键可在 Kendo Grid 中的单元格上导航。

我试图在官方文档中找到一些东西,但没有运气:

http://demos.telerik.com/kendo-ui/grid/keyboard-navigation

请问剑道网格怎么做?

感谢您的帮助。

【问题讨论】:

    标签: javascript kendo-ui telerik kendo-grid


    【解决方案1】:

    您可以使用网格上的 keydown 事件来做到这一点:

    var data = $("#grid").data('kendoGrid');
    var arrows = [37, 38, 39, 40];
    data.table.on("keydown", function (e) {
    console.log(e.keyCode);
      if (arrows.indexOf(e.keyCode) >= 0) {
        setTimeout(function () {
          data.select($("#grid_active_cell"));
        },1);
      }
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-07-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多