Ext modifies GridPanel data and font colors CSS properties and so on

  • 2020-03-30 03:21:38
  • OfStack

Ext modizes GridPanel data, font colors, etc., not just the EditGridPanel

First, get the selected row (or cell, of course) :
 
var selectedRow = grid.getSelectionModel().getSelected(); 

Modify Settings:
 
selectedRow.set("key","value"); 

To modify the background color, first get the line number, and then get the view object of the line:
 
var selectedIdx = grid.store.indexOf(selectedRow); 
var selectedView = grid.getView().getRow(selectedIdx); 

Modify the CSS properties of the line:
 
selectedView.style.color="#FF0000"; //The font becomes red

Related articles: