1

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:

  1. http://www.sencha.com/forum/showthread.php?109751-Add-color-to-column-property-grid
  2. How to apply background color (or custom css class) to column in grid - ExtJs 4?
  3. 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);
    }
}
Community
  • 1
  • 1
Brian
  • 4,958
  • 8
  • 40
  • 56

1 Answers1

0

s. roma

I'm quite an extjs-rookie, but what's about the column-cls: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.column.Column-cfg-cls

afaik you should be able to apply your style there

nemesis
  • 68
  • 2
  • 7
  • I have seen it, but can you give me an example based on what I asked? – Brian Jul 04 '13 at 19:34
  • sorry, maybe a stupid question, but do you want to change the whole COLUMN where 'name' is located, or do you want do chang the CELL? – nemesis Jul 05 '13 at 07:13
  • The whole column, I want to give the user illusion that the whole left column is non-editable. Also maybe change the text color to black and style to bold. – Brian Jul 05 '13 at 07:54