Re: implementing CFGRID filter on CF9, blog examples fail

2011-08-26 Thread Larry Lyons

 Oh drat, I got so caught up in typing up my reply that I forgot to 
 thank you for taking the time to offer a suggestion.  I really did 
 mean to write that first.
 
 -Patti 
N/P. it was only a small suggestion. 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:347031
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: implementing CFGRID filter on CF9, blog examples fail

2011-08-25 Thread Larry Lyons

Off the top of my head, do you have a mapping to the /CFIDE/scripts directory, 
or is it accessible to the browser? It may be that CF is not finding the 
scripts it needs to run cfgrid.

hth,
larry

 Running ColdFusion Server Standard 9,0,0,251028 and using CFGRID for 
 the first time in years.  It was going just fine until I started 
 trying to implement a filter.
 
 First I found Dan Vega's blog: http://www.danvega.
 org/blog/2008/3/10/ColdFusion-8-Grid-Filtering
 
 I downloaded his source and ran it... the grid displays, but no filter.  
 I'm not proficient at debugging Ajax, but what I did do was:
 
 1) Copy the toolbar.js and button.js to the same directory as the code 
 to be sure.  I did this because the path on my server to these files 
 was different than the path his example expected... when that didn't 
 work I used the webs to borrow someone else's copy that was in the 
 path Vega expected... but of course that still didn't work.
 
 2) I then wanted to check the first step of all the js setup and wrote 
 an alert:
   
 alert(ColdFusion.Grid.getGridObject('ArtistGrid'));
   
 result: undefined
 
 Vega's example was written for CF 8.  I found another one that was 
 written for CF9: http://www.thecfguy.com/post.
 cfm/add-header-in-cfgrid-in-coldfusion-9
 
 This too used the Artist dsn so I copied it verbatim and tried it out.  
 Same stuff.  No actual errors but the EXT toolbar doesn't display, the 
 alert shows undefined and I don't really know what I can do to 
 diagnose what is going on.
 
 Any help?  Can someone run these examples on CF 9 and let me know if 
 it works fine for them?  If it DOES, any clues what is my malfunction?  
 Is it that I don't have the 9.01 update installed (not my choice, that... 
 I don't have control over these servers).
 
 -Patti 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:347000
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: implementing CFGRID filter on CF9, blog examples fail

2011-08-25 Thread Patricia Geneva

Yes, Yes, No.

My research tells me that the examples I found that were written for cf8 just 
won't work because of the major differences between its version of EXTjs and 
cf9+. I suspect taht the example I found for cf9 won't work because of the 
minor difference between cf9.0 and 9.01.  AT the very least, using the header 
toolbar is hosed for 9.0 and i don't have the time to dig into how to 
manipulate EXTjs directly.

I did find that one thing I was doing wrong was populating my CFGRID with a 
CFQUERY.  In order to get the bottom toolbar and paging to work, I needed to 
get rid of the query and do a bind to a CFC method.  

My final fix, to get my top toolbar approximation with a filter was to just 
hand code a HTML drop box as part of the CFFORM and bind it too:

// for the cfgrid
args = structNew();
args.bind = 
cfc:ebusiness.getFundingTransactions({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},{filter});
args.onchange = 
cfc:ebusiness.psbFunding.edit({cfgridaction},{cfgridrow},{cfgridchanged});


then

!--- The GridRender function needs to be in the head so it exists before the 
CFGRID attempts to reference it ---
cfsavecontent variable=gridRenderJS 
script  type=text/javascript
var gridRender = function()
{
grid = 
ColdFusion.Grid.getGridObject('eBusinessGrid');
var bbar = 
Ext.DomHelper.overwrite(grid.bbar,{tag:'div',id:Ext.id()},true);

gbbar = new Ext.PagingToolbar({
renderTo:bbar,
store: grid.store, 
pageSize: 50,
displayInfo: true,
displayMsg: 'bShowing {0} - {1} out of {2}/b',
emptyMsg: bNo Records/b
});
};  
/script
/cfsavecontent
cfhtmlhead text=#gridRenderJS#


then

cfform
  ... stuff...
select name=filter id=filter ... /select
cfgrid attributeCollection=#args# ... /cfgrid
cfset ajaxOnLoad(gridRender)
/cfform


 Off the top of my head, do you have a mapping to the /CFIDE/scripts 
 directory, or is it accessible to the browser? It may be that CF is 
 not finding the scripts it needs to run cfgrid.
 
 hth,
 larry 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:347013
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: implementing CFGRID filter on CF9, blog examples fail

2011-08-25 Thread Patricia Geneva

Oh drat, I got so caught up in typing up my reply that I forgot to thank you 
for taking the time to offer a suggestion.  I really did mean to write that 
first.

-Patti 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:347014
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm