Skip to main content
Inspiring
February 9, 2010
Question

cfgrid, checkboxes in non-edit mode

  • February 9, 2010
  • 1 reply
  • 3874 views

I have a nice data-entry form that works great.  I have gotten a simple cfgrid to work nicely, displaying contract articles.

The cfgrid opens in a sweet popup window using cfwindow.  Now here are my problems:

  1. The cfgrid is read-only.  I do not want the user updating this data!
  2. There are 16 pages of contract articles, from which the user may select up to 10; however, they must select at least 1 article.
  3. No matter what I try, I cannot get check boxes to appear in the first column of the grid.  There's a column there, with my header, but no boxes.
  4. The current system forces the user to select and save the applicable articles from each page on which they appear.  What they want is the ability to click the check box, scroll to the next page (or 7) and select another without having to press Save each time (or leave the pop up window until they have selected all their articles).
  5. Once the user selects their articles, how do I access their choices?

Here's my code:

The query to populate the grid:

   <cfquery datasource="#REQUESTDataSource#" name="articles">

          SELECT ArticleName from Articles ORDER BY ArticleNumber

     </cfquery>

     <cfreturn QueryConvertForGrid(articles, page, pageSize)>    

The code that calls the pop-up window:

     <cfinput type="button" name="popArticles" onClick="ColdFusion.Window.show('ArtPopUp')

           value="Click to select Contract Articles">

The code that opens the window and displays the grid:

     <cfwindow name="ArtPopUp" initShow="false" center="true" title="Select Contract Articles">

          <cfform>

               <cfgrid name="ArticleGrid" format="html" selectonload="false" selectmode="row"

                              bind="cfc:Functions.GetArticles({cfgridpage}, {cfgridpagesize},

                                               {cfgridsortcolumn}, {cfgridsortdirection})">

                    <cfgridcolumn name="selectArt" header="Select" select="true" type="boolean"

                        values="1" display="yes">

                    <cfgridcolumn name="ArticleName" header="Contract Articles" select="no">

               </cfgrid>

          </cfform>

     </cfwindow>

I've tried SelectMode="edit" with a corresponding "onChange" entry, but that didn't work.

Thank you in advance for your help.

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    February 14, 2010

    It's too much to take in at once. What in particular is the problem?

    Inspiring
    February 16, 2010

    Agreed.  Starting at the end of a bunch of code  that doesn't work isn't the way to troubleshoot.

    First things first: can you get a standalone <cfgrid> (with hardcoded data) to display with the checkboxes in one column?  If yes, factor in another bit of your solution.  Keep factoring bits in to it until you hit a wall.  Try to work out why you hit a wall.  If you can't work it out, report back.  Keep the code as simple and self-contained as possible whilst you're troubleshooting.  Once you understand the solution, apply it to your requirement.

    --

    Adam