CFGRID html with bind - not rendering, getting spinner
Sorry to bother everyone again, but I am again needing assistance with converting my CFGRIDS from applets to html formats using CFC and binds.
I have been testing the grids one step at a time - first by just adding the format="html" and enclosing the CFGRID within a CFFORM. Looks okay. Then I created the cfc and moved the query, and created the bind. Now I get the grid appearing without any data, and the spinner in the base of the grid.
Here is my code: payment.cfc
<cfcomponent>
<cffunction name="getData" access="remote" output="false">
<cfargument name="page">
<cfargument name="pageSize">
<cfargument name="gridsortcolumn">
<cfargument name="gridsortdirection">
<cfquery name="payment_all" datasource="Treasury">
SELECT Payment_Type, Payment_Desc
FROM paytype
<!--- <cfif gridsortcolumn# NEQ "" or gridsortdirection NEQ "">
order by #gridsortcolumn# #gridsortdirection#
</cfif> --->
</cfquery>
<cfreturn QueryConvertForGrid(payment_all, page, pageSize)>
</cffunction>
</cfcomponent>
My grid: paymentgrid.cfm
<cfform>
<cfgrid format="html" name="paymentcodegrid" height="254" width="315"
pagesize=10 selectmode="row" striperows="yes" font="Arial" fontsize="10"
bind="cfc:payment.getData({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})" >
<cfgridcolumn name="Payment_Type" header="Payment Code" width="95" />
<cfgridcolumn name="Payment_Desc" header="Payment Description" width="200" />
</cfgrid>
</cfform>
Both my cfgrid and my cfc are textbook copies from the ColdFusion manual's. My results are all but textbook. First of all, the page with the CFGRID renders the grid empty, with the spinner in the bottom of the grid next to the >| button for the last page. No error is returned in the application.log or the exception.log.
Also, I have taken to commenting out the
<cfif gridsortcolumn# NEQ "" or gridsortdirection NEQ "">
order by #gridsortcolumn# #gridsortdirection#
</cfif>
statement from my query. When I leave it in as is, I get a SQL Server error - "Error Executing Database Query.[Macromedia][SQLServer JDBC Driver][SQLServer]Incorrect syntax near the keyword 'ASC'. The specific sequence of files included or processed is: E:\inetpub\WWWROOT\Treasury\payment.cfc, line: 12 "
I have tried putting a default into the cfargument statements push the values, didn't work. I even commented out the statement and just put in a regular 'order by' statement, and still get the same results.
So I've tried this both in CF 9,0,2,282541 and on CF10, so I am really stumped. I've searched the internet and spent days with folks that have spent years working on ColdFusion with no luck.
Windows 2008, SQL Server 2008R2.
Any ideas would be greatly appreciated.
Thanks. Libby H.
