Forum
08:21
12/11/2010
I am trying to do in place editing using jquery.jqGrid-3.8.1.
jQuery(document).ready(function(){
var lastsel2;
jQuery("#list").jqGrid({
url:'Grid',
datatype: 'xml',
mtype: 'GET',
colNames:['APP_ID','CODE', 'VALUE'],
colModel :[
{name:'APP_ID', index:'APP_ID', width:100, editable:true, edittype:"text", editoptions:{size:10, maxlength: 15}},
{name:'CODE', index:'CODE', width:100, editable:true, edittype:"text", editoptions:{size:10, maxlength: 15}},
{name:'VALUE', index:'VALUE', width:500, align:'right', editable:true, edittype:"text", editoptions:{size:10, maxlength: 15}}],
pager: jQuery('#pager'),
rowNum:10,
rowList:[10,20,30],
sortname: 'id',
sortorder: "desc",
viewrecords: true,
imgpath: 'themes/basic/images',
gridComplete: function(){
var ids = jQuery("#list").getDataIDs();
for(var i=0;i < ids.length;i++){
var cl = ids[i];
se = "<input type='button' value='Save' onclick="jQuery('#list').saveRow('"+cl+"',checksave);" />"; //checksave is a callback function to show the response of inline save controller function
ce = "<input type='button' value='C' title='Cancel' onclick="jQuery('#list').restoreRow('"+cl+"');" />";
jQuery("#list").setRowData(ids[i],{act:se+ce}); //Save and Cancel buttons inserted via jqGrid setRowData function
}
},
onSelectRow: function(id){
if(id && id!==lastsel2){
jQuery('#list').restoreRow(lastsel2); //restore last grid row
jQuery('#list').editRow(id,true); //show form elements for the row selected to enable updates
lastsel2=id; //save current row ID so that when focus is gone it can be restored
}
},
caption: 'My first grid'
});
});
function checksave(result)
{
if(result.responseText!='') alert(result.responseText);
else $("#list1").trigger("reloadGrid");
}
</script>
Whenever I try to run following code in firefox 3.6, I get following error in firebug console
createEl is not defined. Is there any different plugin for in place editing? Also Can any one suggest me how to add edited data into database after editing it?
19:09
Moderators
30/10/2007
Hello,
Please, be a sure that you have marked all the needed modules for editing when you download the grid.
http://www.trirand.com/blog/?page_id=6
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
33 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66