OK, you have your grid object, 'mygrid', now you can do a bit more
before your .reconfigure(). Create your paging Toolbar. First you need
to get your grid footer:
var gridFoot = mygrid.getView().getFooterPanel(true);
After this you create a new PagingToolbar:
var paging = new Ext.PagingToolbar(gridFoot,ds,{
pageSize:25, //number of records displayed in grid
displayInfo:true,
displayMsg:'Displaying records {0} - {1} of {2}',
emptyMsg:"No records to display"
});
Somewhere after this is your mygrid.reconfigure(ds,cm), which will
reload the grid with the changes.
Steve "Cutter" Blades
Adobe Certified Professional
Advanced Macromedia ColdFusion MX 7 Developer
_____________________________
http://blog.cutterscrossing.com
Paul Stewart wrote:
> Hi, I have been using the CFgrid tag in CF8 (format HTML, bound to a
> cfc), and i have got it do almost all that i need it do (see below).
> Except that i don't know how to get access to the TOTALROWCOUNT figure
> that i can see in the debugger returned from the CFC , and also be able
> to display that figure either on the bottom of the grid itself (using
> ext.toolbar???), or even above it on the page using another ajax method??.
>
> I need to do this show the user amount of records returned from his/her
> search. i.e 'your search returned x number of records.' From reading Ray
> Camden's blog I know i have to use the underlying Ext library that the
> cfgrid tag is based on, and i have used his solution to format some
> columns in the grid (nice one Ray). But i am not really getting anywhere
> (hopelessly bamboozled) with the records returned figure.
>
> If any kind person would like to me help me i would be indebted to them.
>
> <!---needed to get access to Ext ajax library --->
> <cfajaximport/>
>
> <!---usinsg Ext library to format the grids MTI and MPI column data
> with £ signs--->
> <script>
> myf = function(data,cellmd,record,row,col,store) {
> return "£ " + data;
>
> }
> formatgrid = function() {
> mygrid = ColdFusion.Grid.getGridObject('ad');
>
> cm = mygrid.getColumnModel();
> cm.setRenderer(3,myf);
> cm.setRenderer(5,myf);
>
> mygrid.reconfigure(mygrid.getDataSource(),cm);
> }
> </script>
>
>
> <!---grid bound to search.cfc --->
> <cfgrid striperows="true" selectmode="row" name="ad"
> bind="cfc:search.doFranchiseSearch({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},{form2:regionId},{form2:countyId},{form2:franchiseTypeDescription},{form2:cat2},{form2:IndustrySectorName},{form2:cat})"
>
> format="html">
> <cfgridcolumn name="Id" display=false />
> <cfgridcolumn name="companyName" href="/franchisorPage.cfm"
> hrefkey="Id" display=true header="Franchise" />
> <cfgridcolumn name="ftype" display=true header="Type"/>
> <cfgridcolumn name="cat2" select="yes" display="true"
> header="MTI - £" />
> <cfgridcolumn name="sector" display=true header="Industry" />
> <cfgridcolumn name="cat" display=true header="MPI - £" />
> <cfgridcolumn name="countyId" display=true header="Countyid" />
> </cfgrid>
>
> <!---Call js format function --->
> <cfset ajaxOnLoad("formatgrid")>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:296658
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4