Grid cell borders

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
BFoster
Profound User
Posts: 50
Joined: Fri May 24, 2019 6:26 am
First Name: Ben
Last Name: Foster
Company Name: Manhattan Assurance Company
Contact:

Grid cell borders

Post by BFoster »

I have a user requesting a red border color around individual grid input-fields when the input-field gets focus and of course when the field is blurred remove the red border. It's a high volume application and the user is looking at a document for the value and wants the field she is working to have its border outlined in red. I'm doing it for the control record input-fields using the onfocus and onblur events. That approach doesn't seem to apply with a grid. Is this even possible?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Grid cell borders

Post by Scott Klement »

onfocus/onblur work the same in grids as anywhere else...
BFoster
Profound User
Posts: 50
Joined: Fri May 24, 2019 6:26 am
First Name: Ben
Last Name: Foster
Company Name: Manhattan Assurance Company
Contact:

Re: Grid cell borders

Post by BFoster »

You referred to grid in your reply. I am trying to change the border color of a cell when that cell receives focus. I do not see any grid methods that fits the bill.

This is the JS code I'm using for an input-capable field in the control record. This approach does not work for a subfile field as the method "applyProperty" is not available for a grid object.

applyProperty("C1TOTCHRGE", "border bottom color", "#FF3366");
applyProperty("C1TOTCHRGE", "border left color", "#FF3366");
applyProperty("C1TOTCHRGE", "border right color", "#FF3366");
applyProperty("C1TOTCHRGE", "border top color", "#FF3366");

applyProperty("C1TOTCHRGE", "border bottom width", "medium");
applyProperty("C1TOTCHRGE", "border left width", "medium");
applyProperty("C1TOTCHRGE", "border right width", "medium");
applyProperty("C1TOTCHRGE", "border top width", "medium");
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Grid cell borders

Post by Scott Klement »

The IDs of fields in a grid are suffixed with the row number. So "C1TOTCHRGE.1" for row 1, "C1TOTCHRGE.2" for row 2, etc. Aside from that, applyProperty() works exactly the same in the grid as it does outside of the grid.
BFoster
Profound User
Posts: 50
Joined: Fri May 24, 2019 6:26 am
First Name: Ben
Last Name: Foster
Company Name: Manhattan Assurance Company
Contact:

Re: Grid cell borders

Post by BFoster »

Ah! Thanks, Scott.
BFoster
Profound User
Posts: 50
Joined: Fri May 24, 2019 6:26 am
First Name: Ben
Last Name: Foster
Company Name: Manhattan Assurance Company
Contact:

Re: Grid cell borders

Post by BFoster »

One more: This is sort of a chicken and egg relationship. All of the grid methods require RRN to isolate a row and the same RRN is used to change a field's border property. When the onfocus event fires due to a user selecting or more central to the problem - tabbing into - a subfile field, how is RRN obtained?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Grid cell borders

Post by Scott Klement »

It will automatically define variables named rowNumber and rrn
  • rowNumber = physical row number on the screen. This will change when you sort the grid.
  • rrn = the original row number (and the one that your server-side code uses to refer to rows). This sticks with the row when you sort the grid. This is probably what you want to use, here.
So you should be able to code it like this:

Code: Select all

applyProperty("C1TOTCHRGE." + rrn, "border bottom color", "#FF3366");
BFoster
Profound User
Posts: 50
Joined: Fri May 24, 2019 6:26 am
First Name: Ben
Last Name: Foster
Company Name: Manhattan Assurance Company
Contact:

Re: Grid cell borders

Post by BFoster »

Once again, thanks, Scott.
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests