PDA

View Full Version : how to use Ext.grid.GridPanel, Ext.ux.grid.LockingColumnModel in cfgrid



nadermfr
26 Jan 2011, 10:34 PM
I need to implement the following example to coldfusion
http://dev.sencha.com/deploy/dev/examples/grid/locking-grid.html


with colfusion.grid.getobject
I would like to freeze columns and use the Ext.ux.grid.LockingColumnModel in coldfusion
I have and editable cfgrid bound to cfc's
<script>
//The functions from the above code snippet are used here
change=function(val){
if(val > 12){
return '<span style="color:green;">' + val + '</span>';
}else if(val < 12){
return '<span style="color:red;">' + val + '</span>';
}
return val;
}
doCellRender = function(colno) {
GradeGrid = ColdFusion.Grid.getGridObject('GradeBookgrid');
cm = GradeGrid.getColumnModel();
cm.setRenderer(1,change);
cm.setRenderer(2,change);
cm.setRenderer(3,change);
cm.setRenderer(4,change);
GradeGrid.reconfigure(GradeGrid.getDataSource(),cm);
}
</script>
<cfform>

<cfgrid name="GradeBookgrid"
pagesize="5"
format="html"
selectmode="edit"
delete="yes"
deletebutton="Delete"
autowidth="yes"
colheaderbold="yes"
picturebar="yes"
sort="no"
bind="cfc:GradeBook.gradebook.cfn_GradeBook_bySectionID_grid({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},1)"
onchange="cfc:gradebook.cfn_GradeBook_EditGrid({cfgridaction},
{cfgridrow},
{cfgridchanged})">

<cfgridcolumn name="StudentID"
header="StudentID"
display="false" >

<cfgridcolumn
name="DisplayName"
header="Student Name"
width="100" select="no">

<cfoutput query="GradeBookHeader">
<cfgridcolumn
name="_#AssignmentID#"
header="#AssignmentTitle#" width="100">

</cfoutput>

</cfgrid>


</cfform>
<cfset ajaxOnLoad("doCellRender")>

Appreciate your help