0

I want to control row focus process. I need to show confirm dialog on row focus change in my table.

I tried to do this with rowClassRules property, but as I understood that functionality apply classes when table rendering, after that row classes stop changing

rowClassRules = {
    'custom-row-focus': (params) => {
      return params.data.id === this.currentSelectedItem.id
    }
  }

currentSelectedItem set's when I click on the row

Max Ivanov
  • 133
  • 1
  • 9

1 Answers1

0

Found an answer in docs

https://www.ag-grid.com/javascript-grid-row-styles/#refresh-of-styles

If you refresh a row, or a cell is updated due to editing, the rowStyle, rowClass and rowClassRules are all applied again.

So, when I'm clicking to the row I should make something like that:

onClicked($event: RowClickedEvent) {
    $event.node.setData({...$event.data});
}
Max Ivanov
  • 133
  • 1
  • 9