Doug's Resume
OO Lexicon
Chat with Doug!
Recent Entries
You may also be interested in...

hotels boeken in 7 sec
Engagement Rings
Online Dating Australia




Czech your Page Rank!
Check Page Rank of any web site pages instantly:
This free page rank checking tool is powered by Page Rank Checker service
Surf's Up!
Visit Egosurf.org and massage YOUR web ego!
My Score: 7,433
Doug's Books

Read

  • Men are from Mars, Women are from Venus
  • The Wisdom of Crowds: Why the Many Are Smarter Than the Few and How Collective Wisdom Shapes Business, Economies, Societies and Nations
  • Blink: The Power of Thinking Without Thinking
  • Head First Design Patterns
  • Transact-SQL Programming
  • What's So Amazing About Grace?
  • Just So Stories (Rudyard Kipling collection)

Reading

  • Prayer: Does it Make Any Difference?
  • Stepcoupling: Creating and Sustaining a Strong Marriage in Today's Blended Family
  • 7 Steps to Bonding with Your Stepchild
  • Keys to Successful Stepfathering

In Queue...

<< September, 2008 >>
SMTWTFS
123456
78910111213
14151617181920
21222324252627
282930
Search Blog

Recent Comments
Re: Using Google as your CF Mail Server (by Kevin Pepperman at 8/30 6:36 PM)
Re: Just What Is 'Application Logic', Anyway? (by Calvin at 8/23 7:15 AM)
Re: Just What Is 'Application Logic', Anyway? (by Charlotte at 8/23 3:12 AM)
Re: What IS 'Business Logic', Anyway? (by Charlotte at 8/22 8:06 AM)
Re: Basic Security in Fusebox 5.5.x (sans XML) (by Jeff Knooren at 8/08 7:06 AM)
Re: American Airlines, YOU SUCK! (by aasux at 8/05 2:59 PM)
Re: How to Think about Controller objects and Model objects (by Rich at 7/31 2:15 PM)
Re: American Airlines, YOU SUCK! (by s at 7/30 10:32 PM)
Re: How to Think about Controller objects and Model objects (by Mark Mandel at 7/29 6:49 PM)
Re: Viewing Option Text (in IE7) that's Wider than the Select List (by dougboude at 7/29 9:04 AM)
Categories
Archives
Photo Albums
Funnies (5)
Family (3)
RSS

Powered by
BlogCFM v1.11

05 July 2008
Helpful Hint for Retrieving CFGRID via Ajax

Here's the scenario...

You're building a Model-Glue application and you're using some Ajax calls to retrieve some data displayed within a CFGRID. When you navigate directly TO the event that performs the Ajax action (index.cfm?event=ajax.getDataSetforEdit&dataSetID=2 , for instance) the page loads just fine and renders the grid without a hitch. When you attempt to retrieve and display it by updating the innerHTML of a target DIV tag, however(something like:

new Ajax.Updater('datatarget','index.cfm?event=ajax.getDataSetforEdit&dataSetID=2',{method:'post',evalScripts: true});

 

)    your browser complains (see the error messages below) and the grid doesn't display!

 

 

 

              Symptom as seen in IE7                                                        Symptom as seen in Firefox's Firebug window

The first thing you need to do is to make SURE that you have a proper server mapping to the CFIDE directory. Not a COLDFUSION mapping, but a WEBSERVER mapping. In IIS you create a virtual directory pointing to CFIDE; in Apache you edit the http.conf file and add an Alias (see my buddy Jim Pickering's post for details on how to do this in Apache). After ensuring that I indeed DID have a proper mapping, I was STILL getting the error...dig dig some more. I finally came across a single, obscure tidbit that turned out to be the answer to the challenge:

 When retrieving and displaying data in a CFGRID via Ajax, your parent page must import the CFGRID library by adding the line: 

<cfajaximport tags="cfgrid" />

 

Typically you don't have to worry about importing any libraries, but in the case of utilizing Ajax to render the grid, you do. In my situation, I'm using Prototype to perform my Ajax calls, so I'm certain this scenario doesn't just apply to those using CF's built in Ajax functionality (and in fact, may not apply at all in that case! I don't know that for sure though).

Anyway, just wanted to post this in case it saves anybody else some time (and so I can reference it next time I run into this and have completely forgotten what the underlying cause is).

Doug out.




Posted by dougboude at 2:59 AM | PRINT THIS POST! |Link | 0 comments
Subscription Options

You are not logged in, so your subscription status for this entry is unknown. You can login or register here.

No comments found.

Name:   Required
Email:   Required your email address will not be publicly displayed.

Want to receive notifications when new comments are added? Login/Register for an account.

Time to take the Turing Test!!!

What letter comes three place(s) after the letter S? (in the alphabet, if that wasn't already apparent)
Type your answer exactly four time(s) in the designated box.

Type in the answer to the question you see above:

Your comment:

Sorry, no HTML allowed!