Skip navigation
Currently Being Moderated

How to alternate color of rows in html cfgrid

Jul 1, 2012 7:45 PM

Hi all

How can I alternate the color of rows in html cfgrid?

I don't have acess to CFIDE/scripts/ajax/resources/ext/css/ext-all.css which is where according to firebug the css styles are kept

Thanks

 
Replies
  • Currently Being Moderated
    Jul 1, 2012 8:23 PM   in reply to goodychurro1

    goodychurro1 wrote:

     

    How can I alternate the color of rows in html cfgrid?

     

    Hi goodychurro1,

     

    The cfgrid attribute you are looking for is "striperows".  Optionally, you can also use the attribute "striperowcolor".  Regarding your question in the other thread about binding href/select to a grid, you can use the following cfscript block to create the 'q' query in the example I posted in that other thread (if you're not on CF10).

     

    <cfscript>

      q = queryNew("myID,myString", "integer,varchar");

      queryAddRow(q, 3);

      querySetCell(q, "myID", 1, 1);

      querySetCell(q, "myID", 2, 2);

      querySetCell(q, "myID", 3, 3);

      querySetCell(q, "myString", "one", 1);

      querySetCell(q, "myString", "two", 2);

      querySetCell(q, "myString", "three", 3);

    </cfscript>

    <cfform>

      <cfgrid name="myGrid" format="html" width="200" query="q" striperows="yes" striperowcolor="##f9f886">

        <cfgridcolumn name="myID" />

        <cfgridcolumn name="myString" />

      </cfgrid>

    </cfform>

     

    Reference:

    - cfgrid

     

    Thanks,

    -Aaron

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 1, 2012 8:39 PM   in reply to goodychurro1

    goodychurro1 wrote:

     

    Thanks!

    You're welcome!

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points