0 Replies - 2705 Views - Last Post: 24 May 2010 - 03:49 PM Rate Topic: -----

#1 Guest_sarahmfr*


adding toolbar to the heater of cfgrid in coldfusion 9

Posted 24 May 2010 - 03:49 PM

I would like to add a toolbar to the footer of an already existing cfgrid. I have 2.3.0
I tried the following but it did not work.
<title>Custom Toolbars Example</title>
<link rel="stylesheet" type="text/css"
href="#application.path#lib/extjs/resources/css/ext-all.css" />
<script src="#application.path#lib/extjs/adapter/ext/ext-base.js"></script>
<script src="#application.path#lib/extjs/ext-all-debug.js"></script>

<script type="text/javascript" src="#application.path#lib/extjs/package/toolbar/toolbar.js"></script>

<script type="text/javascript">
function init()

var grid = ColdFusion.Grid.getGridObject("SectionGrid");
var gridFoot = grid.GridView().getFooterPanel(true);
var gridHead = grid.GridView().getHeaderPanel(true);

var bbar = new Ext.Toolbar(gridFoot);
var tbar = new Ext.Toolbar(gridHead);

bbar.addtext("this is just a trial");
tbar.addbutton({text:"I am a button"});

function(cm,oindex,nindex) {
var dirmsg = '', title = 'You Moved '+cm.getColumnHeader(nindex);
if (oindex > nindex){
dirmsg = (oindex-nindex)+' Column(s) to the Left';
dirmsg = (nindex-oindex)+' Column(s) to the Right';




<cfquery name="getSection" datasource="#application.dsn#">
SELECT SectionID,SectionNumber, SectionName
FROM Sp.Section

<cfset args = structNew()>
<cfset args.name = "SectionGrid">
<cfset args.format = "html">
<cfset args.query = "getSection">
<cfset args.stripeRows = true>
<cfset args.selectColor = "##D9E8FB">

<cfgrid attributeCollection="#args#">
<cfgridcolumn name="SectionID" display="false">
<cfgridcolumn name="SectionNumber" header="SectionNumber">
<cfgridcolumn name="SectionName" header="SectionName">


<cfset ajaxonload("init")>


Thanks in advance

Is This A Good Question/Topic? 0

Page 1 of 1