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

How to alternate color of rows in html cfgrid

Guest
Jul 01, 2012 Jul 01, 2012

Copy link to clipboard

Copied

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

Views

1.2K

Translate

Translate

Report

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

correct answers 1 Correct answer

Engaged , Jul 01, 2012 Jul 01, 2012

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(

...

Votes

Translate

Translate
Engaged ,
Jul 01, 2012 Jul 01, 2012

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
Guest
Jul 01, 2012 Jul 01, 2012

Copy link to clipboard

Copied

Thanks!

Votes

Translate

Translate

Report

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
Engaged ,
Jul 01, 2012 Jul 01, 2012

Copy link to clipboard

Copied

LATEST

goodychurro1 wrote:

Thanks!

You're welcome!

Votes

Translate

Translate

Report

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
Documentation