Entries Tagged as 'ColdFusion 9'
I was really happy when I heard about coldfusion 9.0.1 update and specially because of Amazon S3 could support. Recently I have started working with Amazon S3 Cloud service and writing function for all API call, when I see that new update for ColdFusion having amazon S3 cloud support and I can not stop myself to update it on my development server and my hard time start from here....
Before a month I have posted about "Add header in cfgrid in coldfusion 9" where you can
add ExtJs component in header to filter CFGRID data. One of my blog read
"David" raise that how to bind ExtJs component with CFGRID to filter
result.
Here I will try to explain how to bind header element with CFGRID,
assuming that you have already read my previous post
regarding this topic.
This is little bit tricky to bind with CFC call. We need to create
seperate javascript function which will return value selected from extJS
element.
Previously I have posted about to adding record information in cfgrid footer. Today I was working with adding header in cfgrid, in coldfusion 8 I have work around it but again because of version of Ext 3.0. Here I have tried to demostrate adding header in cfgrid with ext dropdown and reload grid button.
<html>
<head>
<script type="text/javascript">
var gridRender = function()
{
//over
grid = ColdFusion.Grid.getGridObject('artGrid');
var bbar = Ext.DomHelper.overwrite(grid.bbar,{tag:'div',id:Ext.id()},true);
var cmbstate = new Ext.form.ComboBox({
id:"cmbstate",
emptyText:"State",
mode:"local",
width:65,
triggerAction:"all",
displayField:"text",
valueField:"value",
store:new Ext.data.SimpleStore({fields: ["value","text"],data:[['CA','CA'],['CO','CO'],['FL','FL']]})
});
//Insert blank div on top of the grid.
var tbar=Ext.DomHelper.insertFirst(grid.el,{tag:'div',id:Ext.id()},true);
//Convert inserted div to Ext toolbar
var gtbar = new Ext.Toolbar({
renderTo: tbar,
items: [cmbstate,'-',
{
text:"Reload",
cls:"x-btn-text",
tooltip:"Reload",
handler: function(){ColdFusion.Grid.refresh('artGrid');}
},
]
});
gbbar = new Ext.PagingToolbar({
renderTo:bbar,
store: grid.store,
pageSize: 10,
displayInfo: true,
displayMsg: '<b>Showing {0} - {1} out of {2}</b>',
emptyMsg: "<b>No Record</b>"
});
};
</script>
</head>
<body>
<br/><br/>
<cfform>
<cfgrid format="html" name="artGrid" pagesize="10" selectmode="row"
bind="cfc:test.art.getArtists({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})">
<cfgridcolumn name="ARTISTID" display="No"/>
<cfgridcolumn name="FIRSTNAME" header="FIRSTNAME" >
<cfgridcolumn name="LASTNAME" header="LASTNAME" >
<cfgridcolumn name="CITY" header="CITY" >
<cfgridcolumn name="STATE" header="STATE" >
</cfgrid>
</cfform>
<cfset ajaxOnLoad("gridRender")>
</body>
</html>
Below statement will add blank div on top of the grid and later we will conver it to toolbar.
var tbar=Ext.DomHelper.insertFirst(grid.el,{tag:'div',id:Ext.id()},true);
Below code will create our blank div to ext toolbar and in items attributes you can add ext control in it and also link with cfc argument.
var gtbar = new Ext.Toolbar({
renderTo: tbar,
items: [cmbstate,'-',
{
text:"Reload",
cls:"x-btn-text",
tooltip:"Reload",
handler: function(){ColdFusion.Grid.refresh('artGrid');}
},
]
});
Download code
I was working on migration from ColdFusion 8 to ColdFusion 9 for one my client. As I have raised in my other post that Coldfusion 9 is using Ext 3.0 which required some javascript changes if you have used ExtJs function to extend your functionality.
I need to show record information (ex. Showing 1 to 10 out of 15) in CFGRID footer but as usual I require to make changes as per ExtJs version 3.0.
"java.lang.Double cannot be cast to java.lang.String" error you must face if you are previously using ColdFusion 8 and migrating to ColdFusion 9. For one of my client we were migrating from CF8 to CF9, mainly we faces issue related to ExtJs as CF 9 using 3.0 version which I can understand but above error really surprised me as this one is coldfusion error and I found nothing wrong in my code as that was working fine in ColdFusion 8. After googling on I found it was bug and Adobe has consider as hot fixes.
Recent Comments