I am trying to create the checkbox inside the jqgrid columns and using the below code
{
name: 'CanDo', width: 50, index: 'CanDo',
edittype: 'checkbox', editoptions: { value: "True:False" },
formatter: "checkbox", formatoptions: { disabled: true}
}
Json object is returning either "True" or "False"
But the check box itself is not created in grid. What would be the issue?
Please help.
Edit: Using jquery.jqGrid.BasicOnly.min.js 4.1.2
$("#pGrid").jqGrid({
datastr: '@Html.Raw(@Model.PList)',
datatype: 'jsonstring',
colNames: ['id','CanDo' ,'Name'],
colModel: [
{ name: 'id', hidden: true },
{ name: 'CanDo', width: 50, index: 'CanDo',editable: true, edittype: 'checkbox', editoptions: { value: "True:False" }, formatter: "checkbox", formatoptions: { disabled: true},
{ name: 'Name', width: 150 }
],
pager: '#pager',
rowNum: 100,
height: "200",
viewrecords: true,
caption: '<span class="spanH2">Test Process</span>'
});
JSON
{"total":1,"page":1,"records":2,
"rows": [
{"id":"1","cell":["1","True","Callback"]},
{"id":"8","cell":["8","False","Complaint"]}]}
I believe you are missing the editable:true
option. Try this:
{
name: 'CanDo', width: 50, index: 'CanDo',
editable: true,
edittype: 'checkbox', editoptions: { value: "True:False" },
formatter: "checkbox", formatoptions: { disabled: true}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With