How to add Id attribute in checkbox and on onclick call javascript function ?

QuestionsHow to add Id attribute in checkbox and on onclick call javascript function ?
Hemant Mahale asked 6 months ago

Hello Abu,

I wish you are fine there,

m stuck in checkbox column, in which I want to pass user_id in its onclick function but it’s not working now

$col[“name”] = “status”;
$col[“editable”] = true;
$col[“edittype”] = “checkbox”; // render as checkbox
$col[“editoptions”] = array(“value” => “true:false”); // with these values “checked_value:unchecked_value”
$col[“editoptions”][“onclick”] = “function(){ save_user_status({user_id}); }”;
$col[“formatter”] = “checkbox”;
$col[“sorttype”] = ‘text’;

if i write above line than it will console me like
ReferenceError: user_id is not defined[Learn More] why this is so ?

and can we add id Attribute in all checkbox ? so i can save its status in DB

Thanks in Advance.

1 Answers
Hemant Mahale answered 6 months ago

Hello Abu,
I Just referred to your LINK 
and solved my issue
Thanks

Your Answer

17 + 16 =

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!