【问题标题】:How to set css class to a row which has focus in Dojo datagrid如何将 css 类设置为在 Dojo 数据网格中具有焦点的行
【发布时间】:2016-07-28 18:23:12
【问题描述】:

我正在使用 DOJO 数据网格 1.10 版我想要的是在选项卡上索引网格中的行应该突出显示,以便用户能够知道焦点在哪一行。但我没有获得行焦点。

【问题讨论】:

    标签: dojox.grid.datagrid


    【解决方案1】:

    您可以收听dojox.grid.DataGrid::onCellFocus 事件。事件参数是焦点cell-Object 本身和对应的rowIndex

    function onCellFocus(cell, rowIndex) {
    
      // first clear selection
      grid.selection.clear();
    
      // select the focused row
      grid.selection.setSelected(rowIndex, true);
    
      // invoke manually the render method
      grid.render();
    }
    

    我已经为你创建了一个工作小提琴,可以找到 here

    【讨论】:

      猜你喜欢
      • 2010-12-05
      • 1970-01-01
      • 2015-10-13
      • 1970-01-01
      • 2011-01-29
      • 1970-01-01
      • 2014-10-08
      • 2011-05-20
      • 2011-03-26
      相关资源
      最近更新 更多