简体   繁体   中英

Cannot add CSS to ExtJS' propertygrid's column

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);
    }
}

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM