cfGrid, CSS and Custom Date Rendering...

CSS for center align a column: .x-grid-col-2 { text-align:center;

Columns are numbered left to right.  Cells seem to all use the same class.

Sql Server was returning Date Times and I only wanted Dates and I found this code for a customer date renderer very helpful.

setDateRenderer = function(){
mygrid = ColdFusion.Grid.getGridObject('GridName');
cm = mygrid.getColumnModel();
cm.setRenderer(1, Ext.util.Format.dateRenderer('l, F d, Y'));
cm.setRenderer(2, Ext.util.Format.dateRenderer('l, F d, Y'));

I think I found the date formats in the EXT documentation.

No comments: