I want to set the value of a checkbox column to checked when i create a row depending on a condition. However i struggle with the correct syntax. There is an example for a total value, but i tried serverla values: true, checked etc. but that doesn't seem to work. i'm trying: rbf_rbf_setGridValue2(0, 'ispaymentbyguest', rowIndex, ""); where ispaymentbyguest is the name of column. The event is oncreate in the gridcontrol ??
i think i fixed your problem.
i created a method in javascript in the page called rbf_notify(a, b) (see below)
in the oncreate of the grid i've added this:
rbf_notify(##, @@);
//function a = the gridnumber, b the gridrow function rbf_notify(a, b) { /*unique name of the box is based on the integration name with the gridnumber and row*/ var integrationname = "testbox1"; // creating the name. var name = integrationname + "_" + a + "_" + b; // getting all the elements with the name... (unique = 1) var tmp = document.getElementsByName(name); // setting the value to true; tmp[0].checked = true; }
@Edit
you can also use
rbf_setChecked(name, true);
instead of
var tmp = document.getElementsByName(name);
tmp[0].checked = true;
Is this with creating an object or editing an existing one?
Does the value of the checkbox depend on the value of the object or does it depend on the value of the row?
HI ,
can u try with rbf_setChecked(fieldname, isChecked);
Actually i want to fill a checkbox in the grid whebn i create a new row (onCreate)
The value depends on a the situation (i have for differente situations)
if situation 1: checkbox1 = checked, checkbox2 = unchecked
if situation 2: etc.
when i leave the events out is works, but i want to manipulate the checkboxes on create of the row.
PS shkumar the rbf_setChecked cannot be used in the gridcontrol
is the value of the checkbox depening on some value in a row of the grid?
or does it depend on a field that is defined somewhere else in the page?
i think i fixed your problem.
i created a method in javascript in the page called rbf_notify(a, b) (see below)
in the oncreate of the grid i've added this:
rbf_notify(##, @@);
//function a = the gridnumber, b the gridrow function rbf_notify(a, b) { /*unique name of the box is based on the integration name with the gridnumber and row*/ var integrationname = "testbox1"; // creating the name. var name = integrationname + "_" + a + "_" + b; // getting all the elements with the name... (unique = 1) var tmp = document.getElementsByName(name); // setting the value to true; tmp[0].checked = true; }
@Edit
you can also use
rbf_setChecked(name, true);
instead of
var tmp = document.getElementsByName(name);
tmp[0].checked = true;