tags:

views:

1800

answers:

2

how to set style to grid so that it display font-family i am tring like this style: {'font-family': 'Brush Script MT', 'font-weight': 'bold'
} but result does not show according to it.

and i m also trying

style:'font-family:Brush Script MT; font-size:300px', but it also not show the result according to it.. can u pls tell me why?

+1  A: 

I am not an expert in ExtJs but one way to do this is to use getRowClass in the GridPanel to define a function that returns a css class.

Something like

var grid = new Ext.grid.GridPanel({
    store:my_store,
    view: new Ext.grid.GridView({
        //forceFit:false,
        enableRowBody:true,
        ignoreAdd: true,
        deferEmptyText: false,
        emptyText: 'No Record found.',
          getRowClass: function(record, rowIndex, rp, ds){ // rp = rowParams
                if(record.get('f_severity') == 'Critical')
                {
                    return 'x-grid3-row red-class';
                }
                  }
        }),
        bbar:pagingBar,
        plugins: filters,
....

In this example, 'red-class' is a custom CSS class.

Rahul
its not working doesnot give any error but also not give result
vishvesha
This is for overriding default styles at the row level based on business logic. This has nothing to do with setting the default grid style.
bmoeskau
+1  A: 

Font styles are set at the table cell (td) level, so you also have to override them there. Add this to your stylesheet (after the Ext JS stylesheet):

.x-grid3-row td {
    font-family: 'Brush Script MT';
    font-weight: bold;
}

BTW, this is basically a duplicate of your other question. No need to ask multiple times.

bmoeskau
Did this answer your question?
bmoeskau