Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFGrid in CF8

Status
Not open for further replies.

natg504

MIS
Dec 5, 2005
13
US
I'm trying to create a very basic data grid using CF8, but it shows no rows every time. I know the query works on it's own. What am I missing?


<!---survey.cfc--->
<cffunction name="getSurvey" access="remote" returntype="struct">
<cfargument name="page" required="true" />
<cfargument name="pageSize" required="true" />
<cfargument name="gridsortcolumn" required="true" />
<cfargument name="gridsortdirection" required="true" />

<cfif arguments.gridsortcolumn eq "">
<cfset arguments.gridsortcolumn = "Q1" />
<cfset arguments.gridsortdirection = "asc" />
</cfif>

<cfquery name="survey" datasource="myDatasource">
select Q1, Q2, Q3, Q4
from myTable
</cfquery>

<cfreturn queryconvertforgrid(survey, page, pagesize) />
</cffunction>


<!---demo.cfm--->
<cfform name="surveyForm">
<cfgrid format="html" name="surveyGrid" pagesize="10" selectmode="row" bind="cfc:survey.getSurvey({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})">
<cfgridcolumn name="Q1" width="60" header="Q1" />
<cfgridcolumn name="Q2" width="60" header="Q2" />
<cfgridcolumn name="Q3" width="60" header="Q3" />
<cfgridcolumn name="Q4" width="60" header="Q4" />
</cfgrid>
</cfform>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top