Skip to main content
Known Participant
April 28, 2010
Answered

cfgrid questions.

  • April 28, 2010
  • 2 replies
  • 618 views

I've got a cfgrid that is based on  a query, returns all the data fine.  One of the fields, Priority, is in  the database as a 0 or a 1, and in it's previous incarnation was  formatted on the page into showing high or low priority based on this  field.   I was wondering if anyone knew a way to change this so that  there are not a bunch of 0s and 1s in the grid.   Also, it would seem  that with the way I have my code now, the grids display 7 rows at a  time.  The boss has a quirk against scrolling in general, so to try and  work around that I'm trying to increase the maximum amount of rows shown  on the page. Setting maxrows did nothing for me unfortunately.

Here's the  entire page's worth of code, minus the query.  I am using CF 8.

<cflayout  type="vbox" align="center">
    <cflayoutarea name="menu"  overflow="visible" align="center" style="width:100%"  source="menu.cfm"></cflayoutarea>
    <cflayoutarea  name="mainArea" align="center" style="background-color:##CCDBEF;  height:100%">
        <cfform format="flash"  action="respond.cfm" name="openTicket" timeout="300" skin="haloblue"  wmode="opaque">
        <cfformgroup type="panel" label="Open  Tickets">
            <cfif Session.UserTypeID EQ  "1"><cfformitem type="html"><a  href="openTicket.cfm?self=1">View Only Your  Tickets</a></cfformitem></cfif>
             <cfif isdefined("url.complete")and(url.complete EQ  "1")><cfformitem type="html" style="color:##FF0000">Action  Completed Sucessfully</cfformitem></cfif>
             <cfgrid name="ticketGrid" format="flash" maxrows="15"  colheaders="yes" colheaderalign="center" colheaderbold="yes"  rowheaders="no" query="ticket" striperows="yes" gridlines="no"  griddataalign="center">
                <cfgridcolumn  name="ticketID" display="no">
                <cfgridcolumn  name="ufname" header="Assigned">
                <cfgridcolumn  name="dateEntered" header="Date Entered" mask="mm/dd/yyyy">
                 <cfgridcolumn name="fname" header="First Name">
                 <cfgridcolumn name="lname" header="Last Name">
                 <cfgridcolumn name="agency" header="Agency">
                 <cfgridcolumn name="subject" header="Subject">
                 <cfgridcolumn name="priority" header="Priority">
                 <cfgridcolumn name="problem" header="Problem">
             </cfgrid>
            <cfinput type="submit"  name="submitBtn" value="Respond">
        </cfformgroup>
         </cfform>
    </cflayoutarea>
</cflayout>

    This topic is closed to new replies. Start a new post to keep the conversation going.
    Correct answer Remento48
    1. With the 0/1 issue, in Oracle, you can use a DECODE statement in the query. Other databases have this feature but they call it something else.
    2. I think you need to look at setting the height of the grid, not the max rows to increase the number of records shown without scrolling.

    2 replies

    Remento48Correct answer
    Participating Frequently
    May 2, 2010
    1. With the 0/1 issue, in Oracle, you can use a DECODE statement in the query. Other databases have this feature but they call it something else.
    2. I think you need to look at setting the height of the grid, not the max rows to increase the number of records shown without scrolling.
    rdhelmsAuthor
    Known Participant
    May 4, 2010

    Worked like a charm.  Thanks!