hefterr
asked on
CFGRID Column Sorting Issue
Hi,
I have problems with using CFGRID and hope you can help. Here is issues
When sorting (using the header) the 2nd and 3rd columns sort ok, the first causes an error stating an "Error in executing the Query".
Before I thow in a ton of code, I was wondering if anyone had any ideas or how to debug this?
Thanks,
hefterr
I have problems with using CFGRID and hope you can help. Here is issues
When sorting (using the header) the 2nd and 3rd columns sort ok, the first causes an error stating an "Error in executing the Query".
Before I thow in a ton of code, I was wondering if anyone had any ideas or how to debug this?
Thanks,
hefterr
Unless you have the same problem sorting any grid, it sounds data related. I'd check both your ajax log and disk log files to see what the actual query error is. That might give you a better idea of the problem.
ASKER
Funny because the table displays fine. Most grids work fine. In the troublesome ones, only a few columns have sorting issues although they display fine.
Q: ahhhh, how/where do you check these logs?
hefterr
Q: ahhhh, how/where do you check these logs?
hefterr
1) Enable logging in the CF Admin
Debugging & Logging > Debug Output Settings >
(check) Enable AJAX Debug Log Window
(check) Enable Robust Exception Information
....
2) To see the ajax log, append ?cfdebug to your grid page's url
http://localhost/yourGridPage.cfm?cfdebug
3) Regular logs vary by install type. Default locations are c:\ColdFusion9\logs and C:\ColdFusion9\runtime\log s
Debugging & Logging > Debug Output Settings >
(check) Enable AJAX Debug Log Window
(check) Enable Robust Exception Information
....
2) To see the ajax log, append ?cfdebug to your grid page's url
http://localhost/yourGridPage.cfm?cfdebug
3) Regular logs vary by install type. Default locations are c:\ColdFusion9\logs and C:\ColdFusion9\runtime\log
In the troublesome ones, only a few columns have sorting issues although they display fine.
Do they have anything in common? Like always from the same table, the same data type, nullable ..?
Do they have anything in common? Like always from the same table, the same data type, nullable ..?
ASKER
Do they have anything in common?
I think what they have in common is a I populate a column with HTML anchor links. The links show up fine and work. Other columns seem randomly affected by the sorting issue. But this seems to be a common thread. I do this by using the "querynew" function after the SQL and add this column (a trick someone on this site showed me - maybe it was you ;).
I then return the result of the querynew result.
To see the ajax log, append ?cfdebug to your grid page's url http://localhost/yourGridPage.cfm?cfdebug.
I've done this but I'm not sure what to look for. There is a statement in red in the beginning saying there was a problem but all the other notices are green and I'm not sure what to look for?
I think what they have in common is a I populate a column with HTML anchor links. The links show up fine and work. Other columns seem randomly affected by the sorting issue. But this seems to be a common thread. I do this by using the "querynew" function after the SQL and add this column (a trick someone on this site showed me - maybe it was you ;).
I then return the result of the querynew result.
To see the ajax log, append ?cfdebug to your grid page's url http://localhost/yourGridPage.cfm?cfdebug.
I've done this but I'm not sure what to look for. There is a statement in red in the beginning saying there was a problem but all the other notices are green and I'm not sure what to look for?
Errors should be in red. But basically you're looking for more detail about ""Error in executing the Query". ie What was the query error so we know how to fix it.
I do this by using the "querynew" function after the SQL and add this column (a trick someone on this site showed me - maybe it was you ;).
Could be ;-) Hmm... I'm not sure why that would cause a db error. I'd look for the error detail first and see what it says. Don't forget to check the physical logs too. I think db errors should be logged there too.
I do this by using the "querynew" function after the SQL and add this column (a trick someone on this site showed me - maybe it was you ;).
Could be ;-) Hmm... I'm not sure why that would cause a db error. I'd look for the error detail first and see what it says. Don't forget to check the physical logs too. I think db errors should be logged there too.
ASKER
I don't think there is a DB/SQL error. I think the error is a general AJAX one about invoking the cfc only on some column headers. I am not on my development pc now. I'll look at the error logs tomorrow.
Is there a way in Firefox todebug what is happening using the developer tools?
Is there a way in Firefox todebug what is happening using the developer tools?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That's some awesome deductive work :)
add a dummy value to the SQL select
Sounds like it should work well. Just cast() it to the correct type if needed.
add a dummy value to the SQL select
Sounds like it should work well. Just cast() it to the correct type if needed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I would've selected yours as the sole solution, cause hey - it was some awesome 'sleuthing' :)
ASKER
I made sure the SQL matched the column names and we all OK now :)
Thanks for the other idea.
Thanks for the other idea.