I'm trying to implement a jqGrid with editable cells:
var myGrid = $("#mygrid").jqGrid({
datatype: 'local',
data: mydata,
colModel: [
{ name: 'Serial', width: 1040, editable: true, edittype: 'text' }
],
rowNum: 10,
rowList: [10, 20, 30],
pager: '#mypager',
sortname: 'Serial',
cellEdit: true,
viewrecords: true,
sortorder: "desc",
onSelectRow: function(id){
if(id && id!==lastSel){
jQuery('#mygrid').restoreRow(lastSel);
lastSel=id;
}
jQuery('#mygrid').editRow(id, true);
}
});
myGrid.jqGrid('navGrid', '#mypager', { edit: true, add: false, del: false, search: true });
However, everytime I try to edit a cell, it allows me to write on it but as soon as I click on other row or even outside the grid, the text dissapear.
Another thing, everytime I hit "enter" it tries to submit something because it shows me the following message: "No url is set".
And of course, I only want to use this grid 'locally'. After editing the grid the user will have to click on a "Submit" button that is included in the .html and then I will manage the data inserted on the grid.
Thx.