I would like to set the error tooltip of specific elements on a grid row. The pui.errorTip takes an object id for it's first parameter. Is there a way to get a specific row element's id to use in this API?
It feels like pui.errorTip has extended applyProperty. It uses the same object id parameter. I feel if I know how to reference a specific element on a row, I will get the direct access to each grid row element.
Thanks!
Grid Element Properties
-
- Profound User
- Posts: 61
- Joined: Tue Jun 28, 2016 12:53 pm
- First Name: James
- Last Name: Sherwood
- Company Name: Brunswick Boat Group
- City: Knoxville
- State / Province: Tennessee
- Contact:
-
- 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 Element Properties
Elements in a grid have an id that is suffixed by the row number. For example, if you add a textbox with id=Textbox1, then it will be rendered with row 1 as Textbox1.1, row 2 as Textbox1.2, etc.
You should be able to use that id (with the dot row number) as the parameter to pui.errorTip.
You should be able to use that id (with the dot row number) as the parameter to pui.errorTip.
-
- Profound User
- Posts: 61
- Joined: Tue Jun 28, 2016 12:53 pm
- First Name: James
- Last Name: Sherwood
- Company Name: Brunswick Boat Group
- City: Knoxville
- State / Province: Tennessee
- Contact:
Re: Grid Element Properties
Gotcha.
To expand further on the dot number qualification.
The first parameter to errorTip is the object id. I am passing the row number from the Rich Display down to the javascript function. Being the parameter is a string, does that mean I can create a variable and pass that as the object id?
To expand further on the dot number qualification.
The first parameter to errorTip is the object id. I am passing the row number from the Rich Display down to the javascript function. Being the parameter is a string, does that mean I can create a variable and pass that as the object id?
Code: Select all
var gridElementID = "TextBox' + '.' + row; // TextBox.1
pui.errorTip(gridElementID, "This value is required.");
-
- 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 Element Properties
In my example, the id was TextBox1 (not just "TextBox"). And you've switched quote types in the middle of your code, which is a syntax error. But, yeah, the concept is solid.
Code: Select all
var gridElementID = "TextBox1." + row; // TextBox1.1
pui.errorTip(gridElementID, "This value is required.");
-
- Profound User
- Posts: 61
- Joined: Tue Jun 28, 2016 12:53 pm
- First Name: James
- Last Name: Sherwood
- Company Name: Brunswick Boat Group
- City: Knoxville
- State / Province: Tennessee
- Contact:
Re: Grid Element Properties
Good catch on the quotes. I catch myself doing that too often while making a further transition to javascript. Just need to build good habits, ya know?
As always, thanks for your help. Some of us old RPG'ers are trying to push forward. :D
As always, thanks for your help. Some of us old RPG'ers are trying to push forward. :D
Who is online
Users browsing this forum: No registered users and 1 guest