CFGrid Displays No Data Until Sort

So, another annoying bug, but at least I found a solution this one. I'm using Prototype and trying to get CFGrid running. Things went OK except that when I made a grid, it would load looking like the example to the left; no data listed. If you clicked on the "Students" header, you'd get the full list of students like the example on the right.

I was finally able to find an article in the House of Fusion mail archive that described no only the problem, but a solution:

Solution! After tearing the Javascript apart for both libraries, I found the problem. Both libraries use a function called "defer", which basically just delays performing that action until the interpreter's callstack is empty. My solution then was to change the name of this function in Prototype and then just change the name wherever Prototype references it also. None of the Prototype plugins I have use the function, so it's seems like it's pretty low-key.

So I quickly did a find and replace and changed Prototype's "defer" to "pdefer" and things started up fine.

 

Comments

Jon Hartmann, July 2011

I'm Jon Hartmann and I'm a Javascript fanatic, UX/UI evangelist and former ColdFusion master. I blog about mysterious error messages, user interface design questions, and all things baffling and irksome about programming for the web.

Learn more about me.

Post a job. Find one. authenticjobs.com

Interested in becoming a sponsor? Contact me.