4

OK, so I've spent the last couple of days researching this issue on various websites including this one and I'm still no closer to having an answer. I have seen claims that this was a bug and was fixed on Adobe's end in one of the CF11 patches and I have even seen one answer that claimed that Adobe was emailing the fix directly to individuals - though no information on how to go about getting Adobe to do that was provided on that webpage.

We just updated our intranet to Coldfusion 11 and pages that have a cfgrid using the HTML format and bind data from a cfc no longer show the cfgrid on the page. Other pages that use the Flash format with cfgrid (which apparently can't use the bind attribute with Flash) do work. These HTML cfgrid pages were working properly in Coldfusion 9 before we migrated to 11.

I have simplified the code as much as I can to eliminate other error possibilities - i.e. I've stripped out formatting and am pulling only a couple columns from the database. Here is the code I am currently working on in my dev sandbox:

<cfgrid format="html"
        name="userGrid"
        bind="cfc:editorFunc.getGridData({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"
        pagesize="20">
            <cfgridcolumn name="REGION" header="Region">
            <cfgridcolumn name="managmentArea" header="Management Area">
</cfgrid>

Here is the code in the cfc (the query does produce results when dumped to the page):

    <cffunction name="getGridData" access="remote">
    <cfargument name="page">
    <cfargument name="pageSize">
    <cfargument name="gridsortcolumn">
    <cfargument name="gridsortdir">

    <cfquery name="records" datasource="webData">
    SELECT REGION, managmentArea
    FROM areaDesc
    ORDER BY Region ASC
    </cfquery>

     <cfset result = queryConvertForGrid(duplicate(records), arguments.page, arguments.pagesize)>
     <cfreturn result>
</cffunction>

Has anyone had any luck getting a cfgrid like this to work in CF11? I could try a JQuery solution like JGrid, however I would prefer to figure out the existing issue with this code if possible.

Any help is much appreciated.

William
  • 41
  • 3
  • 2
    FWIW, a quick test of the above under 11,0,03,292866 works fine. a) What is your full CF version number? b) When you say "does not work", exactly what happens - no grid, empty grid, ...? c) Any errors in your javascript console or CF logs? – Leigh Dec 04 '15 at 03:19
  • No grid shows. I don't see any console errors in the JS or any CF errors either. We're running version 11,0,07,296330 – William Dec 07 '15 at 21:15
  • Hmm... there should be an error *somewhere*. You checked *both* CF log directories, and any web server logs as well (IIS, etcetera..)? – Leigh Dec 07 '15 at 21:29
  • I don't have access to the web server folders that contain the log file directories. I was looking at the log files in the Coldfusion Administrator. The web server is maintained by our IT shop downstairs. I'll see about getting access to those files as soon as I can touch bases with our CF server guy down there though. – William Dec 08 '15 at 01:55
  • Well, truthfully I would really expect a JS or CF error here. Not to beat a dead horse, but A) are you *positive* there were no errors? B) Are you testing the example above "as is" (no other dependencies) and in a directory outside of any Application.cfc/cfm files that might interfere? C) Did you check the obvious stuff like missing mappings, CFIDE accessibility, ...? – Leigh Dec 08 '15 at 02:12
  • Just to ensure we are working with the same code, can you run [this example](https://gist.github.com/anonymous/10ff824d282556d3bcb3) "as is"? It consists of two pieces: html form and CFC. – Leigh Dec 08 '15 at 02:27
  • Unfortunately our organization has the example code URL blocked as 'personal storage'...gotta love our red tape I guess :) We did try breaking the code out of our framework with a blank Application.cfc and it worked like a charm. Further testing with our layout and Fusebox framework shows it might be Fusebox that is somehow killing it. We're working on why that is happening now. I'll post more info as we figure it out. – William Dec 09 '15 at 01:06
  • Um... charming ;-) Sounds like you are on the right path now though. Let us know how it goes. – Leigh Dec 09 '15 at 01:36

1 Answers1

-1

Add this..

<cfif not len(trim(arguments.gridsortcolumn))>        
    <cfset arguments.gridsortcolumn = "REGION">
    <cfset arguments.gridsortdir = "desc">   
</cfif>

query....

ORDER BY #arguments.gridsortcolumn# #arguments.gridsortdir#

Tom
  • 1