How to add a checkbox in a cell, that is always clickable?

QuestionsHow to add a checkbox in a cell, that is always clickable?
Bob asked 6 years ago

Hi Abu,

Im not sure if thats the correct way to word my question.

Basically… i want to add checkboxes to the last few columns of my grid. when the checkboxes are clicked, it updates the data in my database and refreshes the grid.

Example: (inventory system)

I have checkboxes for "Recieved", "processed" and "complete". If i click the "complete" checkbox, the "LOC" value in my database changes to 'COMP' for that specific entry.

I hope you understand, im not too good at getting what i mean in my head to paper!

Thanks in advance

2 Answers
Bob answered 6 years ago

I would also like to add i know how to change the render type to a checkbox for the column, but they are not clickable unless editing a specific entry. I would like the checkboxes to be clickable at any time whilst on the grid.

Regards

Abu Ghufran answered 6 years ago

Similar question answered here:
http://stackoverflow.com/a/2782019/385377

Equivalent code of grid would be:

$col["formatter"] = "checkbox";
$col["formatoptions"]["disabled"] = false;

and then link JS code ..

// Assuming check box is your only input field:
jQuery(".jqgrow td input").each(function(){
jQuery(this).click(function(){
// POST your data here…
});
});

Your Answer

7 + 10 =

Login with your Social Id:

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!