Web Trenches

ColdFusion 9 CFGRID and getDataSource()

Since the CFGRID component in ColdFusion 9 uses a newer version of Ext than CF8 did, there is a slight change that needs to be made to any scripts that use Ext's getDataSource() method to interact with the grid.  getDataSource() was replaced with getStore().

Since some of my applications need to run on both CF8 and CF9, I use this code to set the data source.

if (mygrid.getDataSource)
      ds = mygrid.getDataSource();  //cf8
      else ds = mygrid.getStore();  //cf9

Then use the ds variable any place I need to refer to it.

5 Replies to “ColdFusion 9 CFGRID and getDataSource()”

  1. Thanks man, we’ve just migrated from CF8 to CF9 and I was wondering if I could solve the issue… till I read your post… Thanks again!

Leave a Reply

Your email address will not be published. Required fields are marked *