0

I'm trying to highlight a row and I've googled for a while however all solutions use functions that don't even exist such as getRow() or highlight().

Does anyone have a solution for it? I've tried the above and the getView().select(record) Neither has worked

Thanks

sra
  • 23,820
  • 7
  • 55
  • 89
Alon_T
  • 1,430
  • 4
  • 26
  • 47

3 Answers3

2

Would selecting the row suffice?

gridPanel.getSelectionModel().select([recordToSelect]);
Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Reimius
  • 5,694
  • 5
  • 24
  • 42
1

You can use the rowClass to modify a row based on record conditions.

yourGrid.getView().getRowClass = function(record, rowIndex, rowParams, store){ 
     return record.get('status').toLowerCase(); // class selection condition
}

See the JSFiddle example for this (very basic example, just show that the row class get ressetted after each change of the record.)

sra
  • 23,820
  • 7
  • 55
  • 89
  • Sounds like implementing something already implemented..or isn't it? – Alon_T Jan 30 '13 at 09:20
  • @user1432779 You have two ways; just select a row as @CD.. mentioned or modify the row style by changing the class and that is exactly for what the `getRowClass` method is; changing row style based on specific condition. An equal example exist for a cell; the `renderer` that can be set in a column cfg. – sra Jan 30 '13 at 09:23
  • @user1432779 For the sake of completeness; a method that just highlight a row based on is rowindex or recerod does not exist. – sra Jan 30 '13 at 09:27
0
grid.getSelectionModel().select(0)
Zakaria Imtiaz
  • 539
  • 5
  • 17