Updating coldfusion 9.0.0 to 9.0.1

Updation of ColdFusion is always painful for me. I am working on ERP level projects which is build on ColdFusion and we have heavily used ColdFusion inbuilt AJAX funtionality, everybody knows that CF use EXTJS for their new ajax component and my favorites are cfgrid, cflayout. But what CF is provide is not always sufficient for client specially working with large project. I have modified cfgrid to put header toolbar and in footer I want to display number of records available etc.

I have started this in ColdFusion 8 and I found really easy to implement it using EXTJS API but when we update it to 9.0 we face lots of issue because of Adobe has started using EXTJS 3.0 instead 1.0 (see blog ) and now again in version 9.0.1 they started using 3.1 and this raise some issue again. This time CF team make this little bit easier for me, they have added new coldfusion javascript function to get header element of cfgrid (ColdFusion.Grid.getTopToolbar).

Below will the code for adding header toolbar in CFGRID.

[code:cf]

var Qcomm = ColdFusion.Grid.getTopToolbar(‘testgrid’);
Qcomm.add(
{
text:"<img src=’/images/remove_filter.jpg’ title=’Remove Filter’>",
cls:"x-btn-text",
tooltip:"Remove Filter",
handler: function(){//code to remove filter.}
},
{
text:"<img src=’/images/icon_refresh.gif’ title=’Refresh’>",
cls:"x-btn-text",
tooltip:"Refresh",
handler: function(){ColdFusion.Grid.refresh(‘testgrid’);}
},
{
text:"<img src=’/images/acceptall.gif’ title=’Accept Communication(s)’>",
cls:"x-btn-text",
tooltip:"Accept Invoice(s)",
handler: function(){}
}
);

ColdFusion.Grid.showTopToolbar(this.gridName);

[/code]

First line get header of cfgrid and then added extjs element into toolbar and finally call showTopToolbar function to render it on grid.

 

Hope this help…

PS.: this code only work with update 9.0.1 as getTopToolbar function introduce in this function.