How can I set a Checkbox-value in a grid?

Posted by smartsysISV on 08-Sep-2014 11:47

I try this and some other but I cannot set the checkbox:

rbf_setGridValue2(0, "fieldname", radno, true);

Posted by pvorobie on 08-Sep-2014 12:04

Try something like this:

var field = eval('document.theForm.'+fieldName+'_'+gridNo+'_'+rowIndex);

if (field)

field.checked = true;

All Replies

Posted by Manooj Murali on 08-Sep-2014 11:57

Is the quotes around fieldname intentional?..

Posted by smartsysISV on 08-Sep-2014 12:01

Yes, I use the fieldname with quotes before and after.

Posted by pvorobie on 08-Sep-2014 12:04

Try something like this:

var field = eval('document.theForm.'+fieldName+'_'+gridNo+'_'+rowIndex);

if (field)

field.checked = true;

Posted by smartsysISV on 08-Sep-2014 12:14

Thank you!!

This solution works fine.

Posted by Gian Torralba on 08-Sep-2014 12:17

Hello,

You can use JQuery to achieve this since the rbf_setGridValue API will not set the check box to checked.

$("input[name='is_active_"+gridNo+"_"+index+"']").attr("checked",true);

Thanks,

Gian

Posted by Manooj Murali on 08-Sep-2014 12:50

So, just one question, what kind of fields does this function support then?

Posted by pvorobie on 08-Sep-2014 12:55

Text fields should work fine. I'll double check and enhance this function to work with check boxes as well.

Posted by Manooj Murali on 08-Sep-2014 22:31

Thanks Pavel.

This thread is closed