3.25.2009

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.
http://www.coldfusionguy.com/ColdFusion/blog/index.cfm/2007/11/27/CFGrid-Custom-Date-Renderer

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'));
mygrid.reconfigure(mygrid.getDataSource(),cm);
}

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

queryconvertforgrid() in Coldfusion 8

I have been using ajax a lot more lately on an app I'm working on.   Coldfusion 8 has really made the hard stuff easier but you still have to learn quite a bit about JavaScript.

I only just realized that  the queryconvertforgrid() function takes care of paging for you so you don't send all that data back to the grid.  (I had thought I was sending the whole data set back to the page and it was being paged in the grid...)

After I finish with the ajax, it's back to SAVA.

I Want To Believe

Interesting goings on.   Is this video taken at O'Hare airport of a craft from another world?  Or is it a fake?



How about this pic of a triangular craft  sent to the UFO Casebook?  Alien Craft or Top Secret Military plane Aurora ?

3.17.2009

cf8 Ajax controls overlapping GOTCHA

Ran into this today as I put a bunch of calendar and autosuggest CFINPUTs in a CFFORM.   Surround each cfinput in a DIV with a z-index value.   The lower down the screen, the lower the number.  This means the drop downs on the top of the page will overlap the inputs below them.

Something like:  style="position:relative;z-index:1;"

3.15.2009

onRequest() in application.cfc GOTCHA

If you read the docs it spells it out
Implement this method only if the following are true:
The directory, and any subdirectories affected by this Application.cfc contain CFM files and do not contain any CFC files that are intended to be accessed as web services, using Flash Remoting, or using an event gateway.
I often put my CFCs in a subdirectory under the application during development and I always forget this.   The remote access is needed for the AJAX functionality.

3.07.2009

This is why America gets its news from a comedy show.