ColdExt Alpha 2 release
This release almost took me a couple of weeks to get out the door, and with 5 new tags and 13 updated/improved tags ColdExt is getting that little bit closer to being usable in the real world.
New tags include support for components such as accordions, tools with onclick handlers, tooltips, and xtemplates. The updated tags include better support for container layouts, tabs and treePanels. And there are 2 new demos to check out as well :) As usual, just extract the folders to your webroot to get up and running quickly.
Download ColdExt Alpha 2 from RIAForge
In this release the Ext files are no longer bundled so you will need to head over to the Ext JS Download page, grab the Ext 2.0.1 release and extract it to a temporary directory. Then in your webroot, where you have already placed the "coldext" and "demos" folders from the ColdExt Alpha 2 release, create a new folder called "ext". As per the image below, into the new "ext" folder you just need to place a copy of "ext-all.js" (from the "ext-2.0.1" folder) and "ext-base.js" (from the "ext-2.0.1\adapter\ext" folder), and both the "css" and "images" folders (from the "ext-2.0.1\resources" folder), then you should be right to go.
The first new demo is the ColdExt Accordion demo which is a replica of the Accordion Window that is in the Ext Desktop demo (minus the minimize/maximize functionality).
Here is a screenshot of the accordion demo as it is rendered:
And below is the main chunk of ColdExt code used to construct the accordion demo:
<ext:init />
<ext:onReady>
<ext:createChild renderTo="out" tag="h1">ColdExt Example Accordion (Ext Replica)</ext:createChild>
<ext:window var="myWindow" title="Accordion Window" layout="accordion" iconCls="icon-accordion"
width="250" height="400" border="false" resizable="true" show="true">
<ext:toolbar>
<ext:toolbarButton icon="icons/fam/connect.gif">
<ext:tooltip title="Rich Tooltips" text="Let your users know what they can do!" />
</ext:toolbarButton>
<ext:separator />
<ext:toolbarButton icon="icons/fam/user_add.gif" tooltip="Add a new user" />
<ext:toolbarButton icon="icons/fam/user_delete.gif" tooltip="Remove the selected user" />
</ext:toolbar>
<ext:treePanel id="myTree" title="Online Users" lines="false" rootVisible="false" margin="0 0 5 0">
<ext:tool id="refresh">
<ext:onclick>
var tree = Ext.getCmp('myTree');
tree.body.mask('Loading', 'x-mask-loading');
tree.root.reload();
tree.root.collapse(true, false);
setTimeout(function(){
tree.body.unmask();
tree.root.expand(true, true);
}, 1000);
</ext:onclick>
</ext:tool>
<ext:rootNode>
<ext:treeNode text="Friends" expanded="true">
<ext:treeNode text="Jack" iconCls="user" />
<ext:treeNode text="Brian" iconCls="user" />
<ext:treeNode text="Jon" iconCls="user" />
<ext:treeNode text="Tim" iconCls="user" />
<ext:treeNode text="Nige" iconCls="user" />
<ext:treeNode text="Fred" iconCls="user" />
<ext:treeNode text="Bob" iconCls="user" />
</ext:treeNode>
<ext:treeNode text="Family" expanded="true">
<ext:treeNode text="Kelly" iconCls="female" />
<ext:treeNode text="Sarah" iconCls="female" />
<ext:treeNode text="Zack" iconCls="green" />
<ext:treeNode text="John" iconCls="green" />
</ext:treeNode>
</ext:rootNode>
</ext:treePanel>
<ext:panel title="Settings">
Something useful would be in here.
</ext:panel>
<ext:panel title="Even More Stuff">
Something useful would be in here.
</ext:panel>
<ext:panel title="My Stuff">
Something useful would be in here.
</ext:panel>
</ext:window>
</ext:onReady>
Next up is the ColdExt Combobox demo which makes use of the XTemplate templating features that Ext provides. Templates are mostly used with the DataView component which the Combobox uses internally for rendering its list of items (note that I haven't yet implemented DataViews directly in ColdExt, they will be coming in the next release!). Not only can templates display simple data values but they can do logic, simple calculations and even implement member functions for more complex actions, as per the example below.
Here is a screenshot of the Combobox and XTemplate in action, rendering some data side-by-side in a list:
And below is the code used to produce the Combobox. Take special note of the XTemplate tag and the nested member function that is used in the template, it's a super powerful feature IMO.
<ext:init />
<ext:onReady>
<ext:createChild renderTo="out" tag="h1">ColdExt Custom Example Combobox</ext:createChild>
<!--- coldext custom example - combobox --->
<ext:createChild renderTo="out" tag="h2">Combobox 1 - XTemplate Example</ext:createChild>
<ext:jsonStore var="myJSON" url="data.cfm">
<ext:storeField name="id" />
<ext:storeField name="country" />
</ext:jsonStore>
<ext:formPanel border="false" renderTo="out">
<ext:comboBox name="country" emptyText="Select a Country..." hideLabel="true"
displayField="country" valueField="id" store="myJSON">
<ext:xtemplate>
<tpl for="."><div class="x-combo-list-item">
<span class="country">{country}<tpl if="this.isCode('KZ', id)">, very nice!</tpl></span>
<span class="code">{id}</span>
</div></tpl>
<ext:script>
isCode: function(a, b){
return a == b;
}
</ext:script>
</ext:xtemplate>
</ext:combobox>
</ext:formPanel>
</ext:onReady>
Anyway, that's about it for this release. If you have any questions, comments, feedback or feature requests please feel free to drop me a note in the comments.




Is there a way to populate that tree object dynamically?
many thanks
For some reason, I am having a real hard time grasping the interaction between ColdFusion and Ext. Being a novice at Ext, browsing the API documentation, although it is very complete, there is so much that I can't seem to pull out the important bits that I need to populate a form from a database, post changes to the database, etc.
Anyhow, I shall plod on. Keep up the good work.
As the releases progress I'll include more and more demos which show individual pieces of functionality as well as the more full featured demos. I realise the Ext documentation can be a bit daunting so I am planning some ColdExt documentation as well, initially concentrating on identifying which tags can or must be nested.
However I'm having issues with dynamic loading on any AsyncTreeNode in the tree, it seems like it's not overriding the loader, so only loading the whole tree at once works for now.
@Sana: The ColdExt files are up in SVN on RIAForge now. I'll make updates to the trunk more regularly than releasing zip files, so for example the partial support for dynamic loading in the TreePanel is in SVN now, but not in the downloadable zip file release.
(Those ext controls sure look good.)
Really love your project, thanks for hard work.
one suggestion, extjs forum have more nice extjs themes, whenever possible please add them.
1:black
2:darkgray
3:slate
4:olive
many thanks
You can add the themes by adding the css and image folder for the theme you wish to use into your ext folder.
Then edit init.cfm and an additonal css link to the theme you want to use below <link type="text/css" rel="stylesheet" href="#attributes.css#/ext-all.css"></link>.
EX:
<link type="text/css" rel="stylesheet" href="#attributes.css#/ext-all.css"></link>
<link type="text/css" rel="stylesheet" href="#attributes.css#/xtheme-black.css"></link>
Like Andy, I'm new to EXT and this made it a world easier getting started. Keep up the great work on this!
eg. <ext:init theme="xtheme-gray" />
You could drop in any theme css and images you like, no need for me to bundle them all :)
So far I'm loving ColdExt. A quick question regarding the Paging Grid and ColdSpring. So far I've been able to pupulate the grid from a ColdSpring function call if I use the data attribute instead of url in my JSON datastore, but when I use the data attribute instead of url I get javascript errors when I click on a column header to sort. I would like to populate the grid via ColdSpring and retain the sorting cababilities. Could you possibly point me in the right direction?
Thanks for all your work on this project. It's truely appriciated.
So far I'm loving ColdExt. A quick question regarding the Paging Grid and ColdSpring. So far I've been able to pupulate the grid from a ColdSpring function call if I use the data attribute instead of url in my JSON datastore, but when I use the data attribute instead of url I get javascript errors when I click on a column header to sort. I would like to populate the grid via ColdSpring and retain the sorting cababilities. Could you possibly point me in the right direction?
Thanks for all your work on this project. It's truely appriciated.
missing ] after element list
[Break on this error] Ext.get("out").createChild({tag: "h2", html: "Form 1 - Simple Form"});\n
the center panel code after the form inserted is as follows:
<!--- content --->
<ext:tabPanel region="center" margins="0 5 5 0">
<ext:panel title="ColdExt API" iconCls="icon-docs">
<ext:createChild renderTo="out" tag="h2">Form 1 - Simple Form</ext:createChild>
<ext:formPanel title="Simple Form" frame="true" width="350" renderTo="out">
<ext:input name="firstName" />
<ext:input name="lastName" />
<ext:input name="company" />
<ext:input name="email" />
<ext:timeField name="time" />
<ext:button text="Save" />
<ext:button text="Cancel" />
</ext:formPanel>
</ext:panel>
</ext:tabPanel>
Could you please tell me what i am doing wrong?
If you want to output something at the top of a Panel you can actually use HTML, e.g.:
<ext:panel title="ColdExt API" iconCls="icon-docs">
<h2>Form 1 - Simple Form</h2>
...
I hope that helps :)
1) in Alpha 3 only the treePanel and tabPanel had the borderLayout.region attributes, but I hadn't added support on the gridPanel and formPanel tags. I have since added this support in my local code but not committed it to SVN just yet.
2) formPanel was always trying to declare a JavaScript variable which causes a syntax error when used inside any parent tag other than onReady.
I'll fix this today and put the update into the trunk in SVN on RIAForge, and in future I'll create a branch for each release to make maintenance like this easier between releases.
P.S. There is a *big* update coming... :)
,
I will start building in some error handling into the tags to make tag usage issues like this much easier :)
Thanks and keep up the good work!
How to Load a Grid based on the tree node selection?
I have also send you the code sample to ur email( usedur code sample:)