Slickgrid, how to get the grid item on click event?

user469652 picture user469652 · Dec 3, 2011 · Viewed 20.3k times · Source
grid.onClick.subscribe(function(e) {
    var cell = grid.getCellFromEvent(e),
        row = cell.row;

    // var item = dataView.rows[row];

});

I used to use dataView.rows to access the item inside a grid, and this seems not working in the latest version any more, how shall we update the code?

Answer

Tin picture Tin · Dec 3, 2011
grid.onClick.subscribe(function(e, args) {
  var item = args.item;

  // or dataView.getItem(args.row);
});