0 Replies Latest reply on Oct 12, 2006 5:26 AM by dimsis

    How can i disable a cell in a cfgrid when it's filled from  a query?

    dimsis
      My code:

      <CFSTOREDPROC procedure="tv_Xshell" datasource="#Request.DSN_TV#" username="#Request.DB_USER_TV#" password="#Request.DB_PW_TV#">
      <CFPROCPARAM type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="FROM" value="1/11/2006" null="no">
      <CFPROCPARAM type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="TO" value="31/11/2006" null="no">
      <CFPROCRESULT name="ShellX">
      </CFSTOREDPROC>


      <cfset xx=#ListLen(ShellX.columnList)#-4>


      <CFFORM NAME="GridForm" ACTION="mme_shellX_action.cfm" onload="formOnLoad()">
      <CFGRID NAME="ShellX"
      HEIGHT=600
      WIDTH=800
      HSPACE=10
      VSPACE=6
      ALIGN="CENTER"
      SELECTCOLOR="white"
      SELECTMODE="edit"
      ROWHEADERS="YES"
      COLHEADERS="NO"
      ROWHEADERWIDTH=25
      ROWHEADERALIGN="left"
      QUERY="ShellX"
      GRIDDATAALIGN="left"
      BGCOLOR="white"
      MAXROWS="100"
      >


      <CFGRIDCOLUMN name="prgID" header="prgID" headeralign="left" dataalign="left" width="200" bold="yes" italic="no" select="no" display="no" headerbold="no" headeritalic="no" >
      <CFGRIDCOLUMN name="CZSAA" header="CZSAA" headeralign="left" dataalign="left" width="50" bold="yes" italic="no" select="no" display="no" headerbold="no" headeritalic="no">

      <CFGRIDCOLUMN name="cZoneName" header="cZoneName" headeralign="left" dataalign="left" width="200" bold="yes" italic="no" select="no" display="yes" headerbold="no" headeritalic="no" >
      <CFGRIDCOLUMN name="startTime" header="startTime" headeralign="left" dataalign="left" width="50" bold="yes" italic="no" select="no" display="yes" headerbold="no" headeritalic="no">


      <cfloop index="x" from="1" to="#xx#">
      <CFGRIDCOLUMN name="day_#x#" header="Day #x#" headeralign="left" dataalign="left" width="50" bold="no" italic="no" select="yes" display="yes" headerbold="no" headeritalic="no">
      </cfloop>


      </cfgrid>
      <br /><br />

      <cfoutput><input type="hidden" name="xx" value="#xx#"></cfoutput>
      <cfinput type="submit" name="sub">

      </cfform>

      As you can see i'm filling the grid's data from a query (SP), i have 4 columns with some id's and infos and then follow dynamic fields for days of the month (or period).
      For example if it's february 2006 i'm creating 28 columns, from day_1 to day_28.
      This cells contains (from the query) values 1 or 0.
      The question is how can i dynamicaly check their values and it's 0 disable the cell from editing and change it's color and it's value to blank/null, and if it's 1 only change it's value to blank/null and allow user edit the cell.