how to make the cell not editable on double click?
cells are editable on single click.
i have done cell edit enable using following code:
jQuery("#tree").jqGrid({
url:'json/jsonSamplePots.json',
datatype: "json",
mtype:'GET',
colNames: ["Task id", "Task no.", "Task name", "Priority", "Start", "End", "Effort(hrs)", "Actual start", "Actual end", "Actual effort(hrs)", "Baseline start", "Baseline end", "Baseline effort(hrs)", "Task type", "Link", "Resources", "Tag"],
colModel: [
{name:'id',width: 30, editable:false, align:"right",sortable:false, hidden: true, key: true},
{name:'no',width:80, editable:false, align:"left", sortable:true, sorttype:"int"},
{name:'name', width:150, editable:true, sortable:true, sorttype:"text"},
{name:'priority', width:80, editable:true, align:"right", sortable:true, sorttype:"int"},
{name:'sDate', width:80, editable:true, align:"right", sortable:true, sorttype:"date"},
{name:'eDate', width:80, editable:true, align:"right", sortable:true, sorttype:"date"},
{name:'effort', width:80, editable:true, align:"right", sortable:true, sorttype:"int"},
{name:'asDate', width:80, editable:true, align:"right", sortable:true, sorttype:"date"},
{name:'aeDate', width:80, editable:true, align:"right", sortable:true, sorttype:"date"},
{name:'aeffort', width:80, editable:true, align:"right", sortable:true, sorttype:"int"},
{name:'bsDate', width:80, editable:true, align:"right", sortable:true, sorttype:"date"},
{name:'beDate', width:80, editable:true, align:"right", sortable:true, sorttype:"date"},
{name:'beffort', width:80, editable:true, align:"right", sortable:true, sorttype:"int"},
{name:'type', width:120, editable:true, align:"left", sortable:true, sorttype:"text"},
{name:'link', width:80, editable:true, align:"left", sortable:true, sorttype:"text"},
{name:'resources', width:300, editable:true, align:"left", sortable:true, sorttype:"int"},
{name:'ref', width:80, editable:true, align:"right", sortable:true, sorttype:"int"},
],
rowNum:10,
rowList:[10,20,30],
pager: '#pcolch',
sortname: 'no',
treeGridModel:'adjacency',
autowidth:false,
sortorder: 'desc',
caption:"<a href="#">Task</a>
toolbar:[true,"top"],
treeGrid: true,
cellEdit: true,
sortable: true,
shrinkToFit :true,
//viewrecords: true,
height:'auto',
ExpandColumn:'name',
cellsubmit : 'clientArray',
I suggest to use row editing instead of cellediting. I have been struggling with it for a while but cell editing is not as much flexible that row editing is. With row editing you can reach to exact the same goal as cell editing.
You could use the onCellSelect event to enable ‘cell editing’ (row editing) and use the event parameter to catch if the event is a double click event. I used something similar in my own project:
Note above is just an example, you proberly can’t copy/paste it to use it in your own project. You should test it if it works for you.
Not that the onCellSelect does not work in the celledit mode.
Hope it helps you!