Grid cell borders
-
- 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
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?
-
- 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
onfocus/onblur work the same in grids as anywhere else...
-
- 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
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");
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");
-
- 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
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.
-
- 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
Ah! Thanks, Scott.
-
- 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
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?
-
- 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
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.
Code: Select all
applyProperty("C1TOTCHRGE." + rrn, "border bottom color", "#FF3366");
-
- 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
Once again, thanks, Scott.
Who is online
Users browsing this forum: Google [Bot] and 4 guests