Creating a grid toolbar in ColdFusion 9.0.1
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
