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

Cfgrid question

Explorer ,
Apr 28, 2009 Apr 28, 2009

I am using a cfgrid that provides a starting point for editing records for my users. In a nutshell, the grid shows some record info and when the user clicks the record it takes them to a page so that edits can be made. All is well with that. I am needing to add a column to the grid to put some miscellanious/static items in with their own links. How would I go about doing this? As it seems, if I could just get the items to display, it still would not work because I am using the href options and it looks like it will override anything else. The href key only needs to affect the first seven columns and have no affect on the 'utilname' column, I will have its own static links in that. What can I do to make this work? TIA

<cfgrid  name="requestgrid" query="getOriginalreq" format="html" autowidth="yes" selectonload="false" striperows="yes" gridlines="no" href="editreq.cfm" hrefkey="bcast_id" >
<cfgridcolumn name="bcast_id" header="Broadcast ID" display="no"  >
<cfgridcolumn name="affiliatetype_id" header="Affiliate Type ID" display="no">
<cfgridcolumn name="affiliate_id" header="Affiliate ID" display="no">
<cfgridcolumn name="affiliatename" header="Affiliate Name" >
<cfgridcolumn name="subject" header="Subject" >
<cfgridcolumn name="editcount" header="No. Edits">
<cfgridcolumn name="reqtimestamp" header="Submit Date/Time"  >
<cfgridcolumn name="utilname" header="Admin Functions" display="yes" >***This is the "standalone" column I am needing****

</cfgrid>

TOPICS
Getting started
1.1K
Translate
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
Valorous Hero ,
Apr 29, 2009 Apr 29, 2009

Some steps for you to consider.

To get the data into the grid you can modify your 'getOriginalreq' record set with query functions like queryAddColumn(), querySetCell() and others.

You may be able to do something with a custom render but I do not know if that applies to HTML formated grids.

If not then instead of making the entire row selectable, using the above query functions to modify the record set you should be able to create simple <a>nchor tags as data in given cells.

Translate
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
Explorer ,
Apr 29, 2009 Apr 29, 2009

In this case let me add that I am not entirely set on using the grid, at that point in development the grid seemed like the way to go. Now, some requirements have changed and I have no problems in changing the way I am doing things. My only requirement would be that should I change the process that it is just as intuitive as the grid is to the end users. Let me draw on your experiences as to other feasible ways to go about this. TIA.

Translate
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
Valorous Hero ,
Apr 29, 2009 Apr 29, 2009

Well an easy display would be just to build your own html table, that is all <cgrid...format="html"> does anyway.  Albeit with some JavaScript to add DTHML functionality to said HTML table.

<table>

<cfoutput query="getOriginalreq">

     <tr>

        <td>#<a href="editreq.cfm?id=#bCast_id#>#bCast_id#</a></td>

        <td>#affiliatetype_id#</td>

        ...

         <td><a href="otherPage.cfm">Admin Function</a></td>

     </tr>

</cfoutput>

</table>

As you can see this way it is very easy to create sepeate links on each row going to seperate pages.

You will lose or have to roll your own pagination, column sorting, exctera functionality that may have came with the <cfgrid...> but that can be done.

Also you could modify the record set feeding the grid so that the <a...> tags are part of the data and then use this query to feed a <cfgrid...> tag without the href and hrefkey parameters.  You would then get the same type of display where each row contains two links that you built into the recrod set.

Translate
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
Explorer ,
Apr 29, 2009 Apr 29, 2009
LATEST

Thanks, now I have some things to think about. Much appreciated.

Translate
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