I found some answers on how to apply css to a grid, but none of them helped me in my case.
Here are the links I looked at:
- http://www.sencha.com/forum/showthread.php?109751-Add-color-to-column-property-grid
- How to apply background color (or custom css class) to column in grid - ExtJs 4?
- How can I change the row colour in datagrid based on severity?
Look at this simple example from Sencha:
Ext.create('Ext.grid.property.Grid', {
title: 'Properties Grid',
width: 300,
renderTo: Ext.getBody(),
source: {
"(name)": "My Object",
"Created": Ext.Date.parse('10/15/2006', 'm/d/Y'),
"Available": false,
"Version": 0.01,
"Description": "A test object"
}
});
I am trying to change "name" column's background color and some text formatting. How?
I know hot to get to the column to change it size, but css is not working:
listeners : {
beforerender : function() {
var cols = this.getView().getHeaderCt().getGridColumns();
cols[0].setText("Property");
cols[0].setWidth(150);
}
}