ColdFusion 9 added some new functions for the html grid. I want to take a look at 2 of them today that will make your life a little bit easier. In this example we are going to create a grid and add a toolbar to the grid. In the toolbar we are going to add some buttons with event handlers.
First we need to create a grid to display our artists. Then we use the ajaxOnLoad() method to call a function.
In ColdFusion 9.0.1 we have the ability to get the grids top toolbar. With the top toolbar we can now add elements to it. Finally we use another new function to show the toolbar.
And here is the final result

Just a side note, you can also do this for the bottom toolbar as well. Here is a list of all the new JavaScript functions for the grid.
- ColdFusion.Grid.getTopToolbar
- ColdFusion.Grid.showTopToolbar
- ColdFusion.Grid.hideTopToolbar
- ColdFusion.Grid.refreshTopToolbar
- ColdFusion.Grid.getBottomToolbar
- ColdFusion.Grid.showBottomToolbar
- ColdFusion.Grid.hideBottomToolbar
- ColdFusion.Grid.refreshBottomToolbar

#1 by Henry Ho on 7/29/10 - 6:27 PM
#2 by Mickey on 8/26/10 - 5:14 PM
My grid binds to a CFC and usually produces many pages of results. I'm trying to add a "Please Wait..." type of message and after losing the battle with loadMask, I finally settled for changing the HTML of a DIV object based on certain events (datasource load, header click...) But I can't seem to figure out how to get at the paging buttons at the bottom of my grid to catch when the user clicks one of those.
Can you point me in the right direction on that? Or even better tell me how to get CF to let me use the Ext loadMask?
Thanks!
#3 by Ron on 10/8/10 - 10:44 AM
The two forms inside of CFWindows don't work.
The action part of the forms point to /site/admin/index.cfm?page=1 instead of index.cfm?page=1 How is the action path determined? How can I fix this?
Thanks!