Sunday, June 16, 2013

Populating an ExtJS Tree using ColdFusion

You do not see many ColdFusion examples populating an ExtJS tree. The big challenge is providing the data to the tree. How do yo do it? First of all, extjs is expecting an array of structures. How do you build it? First you define your array:

Then as you loop through your query, your build and populate a structure:








Then add the structure to the array. It should look like this:

" showing here because the code is not displaying properly."



Finally return the array back to the calling program:
 

  
This is done within a CFC defined as such:
cffunction name="getDepartmentsForExtTree" access="remote" returnformat="JSON">
That in a nutshell is how to provide data for an ExtJS tree.

No comments:

Post a Comment