CFGrid Displays No Data Until Sort
- February 18, 2009 3:53 PM
- ColdFusion, Javascript
- Comments (0)
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.