I have true / false values ββin my database. I want to update them using a checkbox in jqgrid. When the value is set to true, it will remain true and should not be changed. Please take a look at my column model:
{ name : 'available', width : 12, resizable: true, editable: true, align: 'center', edittype:'checkbox', formatter: "checkbox", formatoptions: {disabled : false}, classes:'check', editrules:{required:false}, editoptions:{size:39,value:"True:False"} }
I am trying to capture an event when the checkbox is checked, currently they are not all checked, so far I have tried:
jq(".check input").each(function(){ jq(this).click(function(){ aler("works"); }); }); jq("input[type='checkbox']").change(function(){ alert("works"); }); jq(":checkbox").parent().click(function(evt) { if (evt.target.type !== 'checkbox') { var $checkbox = jq(":checkbox", this); $checkbox.attr('checked', !$checkbox.attr('checked')); $checkbox.change(); alert(""); } });
None of these works, I am stuck, do not know what else to try.
When checking the flag code with firebug it looks like this:
<input type="checkbox" offval="no" value="false">
source share