Page 1 of 1

onRowClick set Checkbox Checked

Posted: Mon Jul 31, 2017 10:57 am
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 94 times

Re: onRowClick set Checkbox Checked

Posted: Mon Jul 31, 2017 4:33 pm
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.

Re: onRowClick set Checkbox Checked

Posted: Fri Aug 04, 2017 10:44 am
by smohsen
Thanks Matt. It is working great now.
-Sayed