onRowClick set Checkbox Checked

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
smohsen
New User
Posts: 11
Joined: Tue Sep 01, 2015 11:24 am
First Name: Sayed
Last Name: Mohsen
Company Name: Astro-Med, Inc.
Phone: 401-298-8605
State / Province: Rhode Island
Country: United States
Contact:

onRowClick set Checkbox Checked

Post by smohsen »

Hello,
Our user like to see the Checkbox on a grid is “Checked” when they click anywhere on a row.
I have tried the following code in "OnRowCliclick event but it is not working:

pui.set("chkBox", "1");
changeElementValue("chkBox", "1");

I am not sure it is possible to accomplish that.

Thank you,
CheckBox .docx
(34.83 KiB) Downloaded 93 times
User avatar
matt.denninghoff
Profound Logic Staff Member
Posts: 115
Joined: Wed Feb 10, 2016 3:53 pm
First Name: Matthew
Last Name: Denninghoff
Company Name: Profound Logic Software
State / Province: Ohio
Country: United States
Contact:

Re: onRowClick set Checkbox Checked

Post by matt.denninghoff »

There are a couple things needed to make your code work. First, when you call pui.set, the second parameter should be "value", and you'll need to set the "checked" property on the checkbox element. Second, when elements are inside a Grid, you must include a period and the row number when you are identifying them.

For example, this onrowclick code should check a box in the row, if the checkbox is named "chkBox":

Code: Select all

pui.set("chkBox."+row, "value", "on" );
getObj("chkBox."+row).checked = true;
I tested this on a checkbox with the "value" property bound to an indicator--format 1/0--the "checked value" property is 1, and the "unchecked value" property is 0.
smohsen
New User
Posts: 11
Joined: Tue Sep 01, 2015 11:24 am
First Name: Sayed
Last Name: Mohsen
Company Name: Astro-Med, Inc.
Phone: 401-298-8605
State / Province: Rhode Island
Country: United States
Contact:

Re: onRowClick set Checkbox Checked

Post by smohsen »

Thanks Matt. It is working great now.
-Sayed
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests