Alon_T
Alon_T

Reputation: 1440

highlight a row in grid using ext js 4.1

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

Upvotes: 0

Views: 3061

Answers (3)

Reimius
Reimius

Reputation: 5712

Would selecting the row suffice?

gridPanel.getSelectionModel().select([recordToSelect]);

Upvotes: 2

Zakaria Imtiaz
Zakaria Imtiaz

Reputation: 539

grid.getSelectionModel().select(0)

Upvotes: 0

sra
sra

Reputation: 23973

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.)

Upvotes: 1

Related Questions