pan1490
pan1490

Reputation: 939

How to set css class to a row which has focus in Dojo datagrid

I am using DOJO datagrid version 1.10 What I want is on tab indexing the row in the grid should get highlighted so that user will be able to know on which row the focus is. But I am not getting the row focus.

Upvotes: 0

Views: 378

Answers (1)

Sebastian Frey
Sebastian Frey

Reputation: 488

You could listen on the dojox.grid.DataGrid::onCellFocus event. The event arguments are the focused cell-Object itself and the corresponding 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();
}

I've created a working fiddle for you, which can be found here.

Upvotes: 1

Related Questions