Home >Web Front-end >JS Tutorial >Ext modifies GridPanel data, font color, css attributes, etc._extjs

Ext modifies GridPanel data, font color, css attributes, etc._extjs

WBOY
WBOYOriginal
2016-05-16 16:44:491579browse

Ext modifies GridPanel data and font color, etc., not just EditGridPanel

First get the selected row (of course you can also get the cell):

Copy code The code is as follows:

var selectedRow = grid.getSelectionModel().getSelected();

Modify the settings:
Copy code The code is as follows:

selectedRow.set("key","value");

Modify the background color, first get the row number, and then get the view object of the row:
Copy code The code is as follows :

var selectedIdx = grid.store.indexOf(selectedRow);
var selectedView = grid.getView().getRow(selectedIdx);

Modify row css attributes:
Copy code The code is as follows:

selectedView.style.color="# FF0000"; //The font turns red
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn