Dharti Sojitra Dharti Sojitra - 3 months ago 18
jQuery Question

editable true in Jquery Grid is not working

I want to make Jq-Grid editable and I tried editable : true but it is not working....

editable : true not working

$(document).ready(function() {

$("#list2").jqGrid({
url: '/Home/GetAll/',
datatype: "json",
contentType: "application/json; charset-utf-8",
mtype: 'GET',
colNames: ['Employee Name', 'Designation',
'Gender', 'DOB'
],
colModel: [
{ name: 'name', index: 'name', width: 150, editable: true },
{ name: 'DesignationID', index: 'DesignationID', width: 150, editable: true },
{ name: 'Gender', index: 'Gender', width: 100, editable: true, editable: true },
{ name: 'DOB', index: 'DOB', width: 150, editable: true }
],
rowNum: 10,
rowList: [5, 10, 15],
pager: '#pager2',
sortname: 'id',
height: 200,
viewrecords: true,
sortorder: "asc",
caption: "Employee Records"
});
jQuery("#list2").jqGrid('navGrid', '#pager2', {
edit: false,
add: false,
del: false
});
});

Answer

You made minor mistake... in you code make edit true instead of false

   jQuery("#list2").jqGrid('navGrid', '#pager2', {
    edit: true,
    add: false,
    del: false
    });
Comments