2

I'm trying to style a row based on an external value in the parent of grid. I've tried using getRowClass and rowClassRules but I don't seem to have access to any data that isn't directly inside of the params value provided. Will I have to add the value of state I'm trying to access to params?

For example, here is something similar to what I'm trying to do:

getRowClass: params => {
  if (params.data.id === MAIN_ITEM_ID) return 'selected-border';
  else if (SELECTED_ITEM_IDS.includes(params.data.id)) return 'selected';
}

The MAIN_ITEM_ID and SELECTED_ITEM_IDS are being set/updated whenever the onSelectionChanged function is run. And I the item that matches ID within MAIN_ITEM_ID to have a border and the other selected rows (SELECTED_ITEM_IDS) will just have a normal colored background

aus_10
  • 141
  • 2
  • 8
  • @NearHuscarl yeah I think that's exactly what I'm looking for. It's funny I've spent a long time looking through their docs but don't remember seeing anything on `context`. Thanks! – aus_10 Oct 15 '20 at 14:31

0 Answers0