Ask a Jedi: ColdFusion 8 and Ext

Johansen asks what I think is a common question now with ColdFusion 8 and it’s Ajax features:

When I look in FireBug's list of included JS-files, and now in the article on Jason Delmore's Blog. It looks like the "EXT JS" library is included in CF8. Maybe it is me, but I have not yet found any documentation on how to use the "EXT JS" in my CF code.

That’s because you aren’t supposed to - not really anyway. “Ext” is not an official part of ColdFusion 8, it is just how ColdFusion 8 does it’s Ajax magic. Now what I just said isn’t 100% true. If you look at your ColdFusion Reference (and I hope you have), you will see a whole section on CF/JavaScript stuff called: Ajax JavaScript Functions

This chapter talks about the various JavaScript functions you can use to help you with ColdFusion 8 Ajax development. Some of these functions relate specifically to Ext:

ColdFusion.Grid.getGridObject
ColdFusion.Layout.getBorderLayout
ColdFusion.Layout.getTabLayout
ColdFusion.Window.getWindowObject

Each of these functions will get you access to the underlying Ext objects used to drive the grids, borders, tabs, and windows. On a related note - ColdFusion.Tree.getTreeObject works the same way, but gets a YUI object instead (from the Yahoo library).

So if you do know Ext, you can use these functions to get the objects and call various methods on them. For an example, see my post on custom grid renderers.

Technically you could call this “using Ext”, but I don’t think it is exactly fair to say you have Ext in CF 8. If I were building an Ajax site from scratch and wanted to use other features of Ext, I would not rely on the libraries that ColdFusion ships and would instead download them direct from Ext instead. It is possible that in future version of ColdFusion, Adobe may switch to a completely new underlying Ajax library. (I doubt it - but…)

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments