Monday, December 10th, 2007

Ext.CFC: Easing Integration with Ext and Adobe ColdFusion

Category: ColdFusion, Sencha

<p>Ext.CFC isn’t about the greenhouse gasses, but instead abstracts out Ext components into the land of CFML:

“The Ext library is packed with tons of cool features, but like most CF programmers, I was initially interested in the Grid Panel. The Grid panel is implemented in ColdFusion 8 using the <cfgrid>, <cfgridcolumn>, and <cfgridrow> tags. Since I started this long before <cfgrid> was a thought, this code will obviously work in CF7.”

Currently the only abstraction is the Grid component, which allows you to do the following in CFML to create a rich grid:

< view plain text >
  1. extobj = createobject("component",extcfc).init();
  2. extobj.initGrid(title="messages",path='http://'&cgi.server_name&cgi.script_name&'?
  3. action=getData',root='messages',id='id',defaultSortColumn=form.sort,defaultSortOrder=form.dir);
  4. extobj.initGridFooter();
  5. //extobj.setGridCol(header='Subject',width=200,name='subject',render="String.format('{0}‘, value)”,detailRender=”String.format(’{0}
  6. {1}’, value,[’body’])”);
  7. extobj.setGridCol(header=’Subject’,width=200,name=’subject’);
  8. extobj.setGridCol(header=’Sender’,width=150,name=’sender’);
  9. extobj.setGridCol(header=’Sent’,width=150,name=’datetime’);

which creates:

Ah, now I can feel a little less guilty about how little we post on Coldfusion…. at least until Rey joined the fun!

Posted by Dion Almaer at 12:02 pm

3.7 rating from 43 votes


Comments feed TrackBack URI

@Dion: Thanks man. Great to see CF love on Ajaxian. :)

Ext.CFC was created by Brian Love and he’s pretty excited about extending it further out and updating it to use Ext 2.0

Comment by Rey Bango — December 10, 2007

I look forward to reviewing the code here. First glimpse, nice work.

Comment by Cutter — December 10, 2007

Thats a very nice setup, but for some reason I can’t help but want ext built into custom tags rather then CFCs, as I tend to equate in my mind that CFCs = processing, and Custom Tags = presentation. Ext lies solidly in presentation land, thus custom tags. Awesome work though, and don’ let CF8′s integration discourage you… Adobe didn’t port even half of Ext to tags, and didn’t do a perfect job at what it did.

Comment by Jon Hartmann — December 10, 2007

@Jon Hartmann: Ext also has a substantial data layer for working with data to and from the server making CFCs an excellent candidate for that portion of the transaction and making Ext not so solidly in presentation land as you originally described.

Comment by JeffHowden — December 11, 2007

@JeffHowden: You’re right that Ext has a very complex data layer, in fact I’d argue that it might be the most important aspect of Ext, but it still lives in presentation land because it is limited to client side processing. If you use a CFC to abstract your Ext objects, its doing exactly the same thing as if you used custom tags to abstract it, because all the CFC or custom tag are doing is converting what you setup into a string of JS for the front end. If you were to write a CFC that Ext interacted with via asynchronous calls it would be different, but thats still the presentation layer communicating with your processing/data.

Comment by Jon Hartmann — December 11, 2007

thanks for that…

Comment by Tribulus — September 22, 2008

Leave a comment

You must be logged in to post a comment.