• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfgrid and <cfoutput query="myQuery" group="GROUP">

Explorer ,
May 14, 2012 May 14, 2012

Copy link to clipboard

Copied

i want to display the records in the cfgrid with cfgridcolumn but wonder if it is possible to use the group by query by any ways?

<cfoutput query="myquery"  group="column">

.....display records here----

</cfoutput>

instead of above cfoutput query, I wan to display them in the cfgrid below but how can i groupd by the ID field here?

<cfform name="frmGrid" id="frmGrid">

            <cfgrid

                name="gridOutages"

                format="HTML"

                query="myquery">

                <cfgridcolumn name="id" header="Message ID" width="50" href="entry_form.cfm?action=edit" hrefkey="id" />

                <cfgridcolumn name="title" header="Title" width="100" />

</cfgrid>

        </cfform>

Thanks

TOPICS
Advanced techniques

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 15, 2012 May 15, 2012

Copy link to clipboard

Copied

As far as I am aware, cfgrid has no functionality equivalent to cfoutput's 'group' attribute. The closest comparison is cfgrid's 'groupfield' attribute. However, the two produce quite different results.

If you apply group="ID" to cfoutput, it will return rows with distinct IDs only. That is, it will pick out the first row that has the ID value, and discard all other rows that share the same ID. Whereas, cfgrid's setting, groupfield="ID", returns all rows, but groups them according to ID value. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 16, 2012 May 16, 2012

Copy link to clipboard

Copied

LATEST

<cfgrid> has its own grouping attribute:

<cfgrid ...

groupField="#myQuery.myColumn#">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation