Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[results] switching colors every row?

Featured Replies

is it possible to make the search result rows like:

white

gray

white

gray

etc...

without using a background picture that is as big as 2 rows and has two different colors?

Adding a field to the database with a calculation? like

if: currentrecordnumber%2=0

gray

else

white

Here's something which may be useful. I copied it a while ago, so I can't give you the proper thread. But I do credit the original poster.

______________

Jeff Spall:

Hi, yes it's quite easy when you've done it!!

Here's one that changes the colour of the table cell. the database has a calculation field 'colourfield', which is:

----------------------

Case(status="on server","66ccff", status="accepted","00cc66", status="resend","ff3300", status="new version","66ccff","ffffff")

----------------------

so the cell turns blue, red, green, white depending on the status of the job in the html:

----------------------

<TD WIDTH=50 BGCOLOR="#[fmp-field:colourfield]">

----------------------

In this database, the text is greyed out when the job is still with the production department, so I use an "IF" in the page:

----------------------

<FONT SIZE="-1" FACE="verdana,arial,geneva,sans-serif"

______________

Or use JavaScript.

  • Author

but this is different... it is based on currentrecordnumber and not a static thing.

How do I make it based on currentrecordnumber?

Here's how I do alternate row colors.

1) Create a calculation Field, call it rowColor

2) If(Mod(Status (CurrentRecordNumber), 2) = 0, "#CCCCCC", "#FFFFFF")

3) Under Storage Options, make sure and check the "do not store calculated

results box" This will not work unless you do that.

4) In the HTML document:

<table>

[FMP-RECORD]

<tr>

<td bgcolor="[FMP-Field:rowColor]">[FMP-Field:firstName]</td>

<td bgcolor="[FMP-Field:rowColor]">[FMP-Field:lastName]</td>

</tr>

[/FMP-RECORD]

</table>

  • Author

I will try that. Could you explain what what does? or is that a no-ask-question? smile.gif

It's all magic to me but here are a few things that should help you.

> 1) Create a calculation Field, call it rowColor

You will call to this field in your table.

> 2) If(Mod(Status (CurrentRecordNumber), 2) = 0, "#CCCCCC", "#FFFFFF")

Here is the function to determine which color will be used.

Status (CurrentRecordNumber) - will return the number of the current record in the current found set.

Mod - Returns the remainder after CurrentRecordNumber is divided by 2.

If - will return one of the results. In this case a color.

> 3) Under Storage Options, make sure and check the "do not store calculated

results box" This will not work unless you do that.

I beleive the default is set to unchecked.

> 4) In the HTML document:

<table>

[FMP-RECORD]

<tr>

<td bgcolor="[FMP-Field:rowColor]">[FMP-Field:firstName]</td>

This is where you will call to the field that will display the color.

<td bgcolor="[FMP-Field:rowColor]">[FMP-Field:lastName]</td>

</tr>

[/FMP-RECORD]

</table>

Have a great day

Kent

  • Author

thanx I didn't know what Mod was...

but now I know Mod is the same as % in java

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.