Creating a grid toolbar in ColdFusion 9.0.1

Word Count: 1030

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

Comments

#1 Posted By: Henry Ho Posted On: 7/29/10 6:27 PM
Nice, you've always been the cf ajax / ExtJS saviour. Thanks!
#2 Posted By: Mickey Posted On: 8/26/10 5:14 PM
I'm working with a CFGRID in CF8 and have found some of your earlier posts very useful... thanks!

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!


Post Your Comment

Leave this field empty







Show Captcha

If you subscribe, any new posts to this thread will be sent to your email address.

Copyright © 2007 Dan Vega | BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.