Skip to main content
December 10, 2008
Question

Displaying Data in CFGRID

  • December 10, 2008
  • 5 replies
  • 2413 views
I have a very basic CFGRID formatted as HTML and it is tied to a query for pulling the data. The grid works except that the grid data rows don't display until one of the column headers in the header row is clicked. After clicking a column header the data rows show up, otherwise all I get initially is the header row with no corresponding data rows. Any ideas???
    This topic has been closed for replies.

    5 replies

    BKBK
    Community Expert
    Community Expert
    March 7, 2009
    Run the following cfgrid example from the Coldfusion documentation. It uses the built-in database that ships with Coldfusion. So you need to do nothing for it to run, except copy and paste. If you're satisfied, modify your own code accordingly.

    <!--- Query the database to fill up the grid. --->
    <cfquery name = "GetCourses" dataSource = "cfdocexamples">
    SELECT Course_ID, Dept_ID, CorNumber,
    CorName, CorLevel
    FROM CourseList
    ORDER by Dept_ID asc, CorNumber asc
    </cfquery>

    <h3>cfgrid Example</h3>
    <i>Currently available courses</i>
    <!--- cfgrid must be inside a cfform tag. --->
    <cfform>
    <cfgrid name = "FirstGrid" format="html" height="320" width="580" query = "GetCourses">
    </cfgrid>
    </cfform>




    Participating Frequently
    March 7, 2009
    Same issue here, ended up starting another topic since this one wasnt answered.

    Same thing in firefox. So it's not limited to just IE.
    Inspiring
    December 18, 2008
    Try to remove your width and height.
    BKBK
    Community Expert
    Community Expert
    December 14, 2008
    I suspect an AJAX browser quirk in Internet Explorer. What happens when you open the page in Firefox? And when you force a display by adding the attribute selectOnLoad
    ="yes"
    to the cfgrid tag?

    Inspiring
    December 10, 2008
    Hi,

    Can you please post your code here?.
    December 10, 2008
    My code is on different network so I can't copy and past, but here is the gist of what my code looks like...
    <cfform height="200">
    <cfgrid format="html" query="myQry" name="myGrid" width="100%" height="100" pageSize="10">
    <cfgridcolumn header="header1" name="columnName1">
    <cfgridcolumn header="header2" name="columnName2">
    <cfgridcolumn header="header3" name="columnName3">
    <cfgridcolumn header="header4" name="columnName4">
    <cfgridcolumn header="header5" name="columnName5">
    </cfgrid>
    </cfform>

    As I said before... the grid shows up ok with the column headers, but no data rows show up unless you click one of the column headers. That will cause the data rows to show up.