<cfoutput>
<cfscript>
args = {};
args.bind = "cfc:CFC.myCFC.getDataForGrid({cfgridpage},{cfgridpagesize},
{cfgridsortcolumn},{cfgridsortdirection})";
args.delete = TRUE;
args.format = "html";
args.insert = false;
args.name = "SchedulesGrid";
args.pagesize = "5";
args.selectmode = "browse";
args.striperows = TRUE;
args.autowidth = true;
args.height = "205";
</cfscript>
<cfform name="SchedulesForm">
<cfgrid attributecollection="#args#" colHeaderBold="yes" collapsible="true" title="View Created Profile: <b>#Myquery.ProfileName#</b>">
<cfgridcolumn name="ScheduleDetailID" header=" ID" display="no" headerbold="yes" />
<cfgridcolumn name="ScheduleProfileID" header=" Schedule Profile ID" display="no" headerbold="yes" />
<cfgridcolumn name="type" header="Type of " width="108" headerbold="yes" />
<cfgridcolumn name="intervals" header="Intervals" width="108" headerbold="yes"/>
<cfgridcolumn name="IntervalUnit" header="Unit" width="108" headerbold="yes"/>
<cfgridcolumn name="duration" header="Duration" width="108" headerbold="yes"/>
<cfgridcolumn name="to_whom" header="Followed" width="108" headerbold="yes" />
<cfgridcolumn name="reasonDetail" header="Reason" width="108" headerbold="yes"/>
<cfgridcolumn name="frequencyName" header="Frequency" width="108" headerbold="yes" />
<cfgridcolumn name="Template" header="Template(s) attached" width="137" headerbold="yes">
</cfgrid>
</cfform>
</cfoutput>
<script type="text/javascript">
function showWindow(thisID) {
window.open('details.cfm?DetailID=' + thisID,'Details','height=250,width=500,location=0,status=0,toolbar=0,resizable=0');
}
function init(){
grid = ColdFusion.Grid.getGridObject("SchedulesGrid");
cm = grid.getColumnModel();
cm.setRenderer(cm.getIndexById('TYPE'), hrefLinkCreator);
var tbar=Ext.DomHelper.insertFirst(grid.el,{tag:'div',id:Ext.id()},true);
var bbar = Ext.DomHelper.overwrite(grid.bbar,{tag:'div',id:Ext.id()},true);
gbbar = new Ext.PagingToolbar({
renderTo:bbar,
store: grid.store,
pageSize: 5,
displayInfo: true,
displayMsg: '<b>Showing {0} - {1} out of {2}</b>',
emptyMsg: "<b>No Record</b>"
});
var ds = grid.getStore();
gridEl = grid.getGridEl();
grid.loadMask = true;
grid.getGridEl().mask("Please wait - loading data ...");
ds.on('load',function(){
grid.getGridEl().unmask();
});
grid.on('cellclick',function(grid,rowIndex,columnIndex,e){
// We only want action on the 'Details' column
if(columnIndex==2){
// Show the window
var thisID = ColdFusion.getElementValue("SchedulesGrid","SchedulesForm","ScheduleDetailID");
showWindow(thisID);
}
});
};
function hrefLinkCreator(value) {
return '<b style="color:#000;text-decoration:underline;">' + value + '</b>';
}
</script>
showWindow = function() {
var day = new Date();
PID = 'Details' + day.getTime();
var windowOptions = new Object();
windowOptions.width = 700;
windowOptions.height = 300;
windowOptions.x = 400;
windowOptions.y = 400;
windowOptions.modal = true;
windowOptions.refreshOnShow = true;
windowOptions.destroyOnClose = true;
windowOptions.resizeable = true;
windowOptions.initshow = true;
windowOptions.draggable = true;
windowOptions.closable = true;
ColdFusion.Window.create(PID,'Details','details.cfm?DetailID=' + thisID + '&random=' + Math.random(Math.random() * 10000000000), windowOptions);
}
}
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (3)
Commented:
Author
Commented:Cheers
Commented: