Forum
20:07
26/05/2009
Hello,
I had also posted in comments section in 3.5 Beta 2. As suggested by tony I have installed jqgrid.min.js 3.5 beta 2. But I errors with firebug on line 7. I am not sure if this is the reason that after editing form ( add, edit, delete) processing..( processData) get stuck. With Delete the modal window after deleting does not get close after deletion. This is my code!!
I am using struts 2 and loading the data with json. I want to actually use multiselelct but currenlty I have disabled till I solve this issue!!!.
$("#addrow").click(function(){
jQuery("#incomelist").editGridRow("new",
{addCaption:"Add Income",height:200,width:400,
jqModal:false,closeOnEscape:true,
url:"/bp/app/workout/income/add",
bSubmit:"Save",
closeAfterAdd:true,
reloadAfterSubmit:false,
afterSubmit:function reloadGrid(){
jQuery("#incomelist").trigger("reloadGrid");
return true;
}
}
);
});
// edit row function
$("#editrow").click(function(){
var gr = jQuery("#incomelist").getGridParam('selrow');
if (gr!=null){
//editgr=jQuery("#incomelist").getGridParam('selarrrow');
//alert(editgr);
jQuery("#incomelist").editGridRow(gr,
{
editCaption:"Edit Income",bSubmit:"Save",
url:"/bp/app/workout/income/edit",
jqModal:false,closeOnEscape:true,height:200,width:400,
beforeShowForm : function (formid){
$("#pData, #nData",formid).hide();
},
closeAfterEdit:true,
reloadAfterSubmit:false,
afterSubmit:function reloadGrid(){
jQuery("#incomelist").trigger("reloadGrid");
return true;
}
}
);
//end of if grid
} else {
alert("Please select a row for editing");
}
});
// delete row function
$("#deleterow").click(function(){
var gr = jQuery("#incomelist").getGridParam('selrow');
//getSelectedRow();
if( gr != null ) {
alert(gr);
jQuery("#incomelist").delGridRow(gr,{reloadAfterSubmit:false,
url:"/bp/app/workout/income/delete",jqModal:false,closeOnEscape:true,
caption:"Delete Income(s)",
afterSubmit:function reloadGrid(){
jQuery("#incomelist").trigger("reloadGrid");
return true;
}
});
}
else {
alert("Please Select Row to delete!");
}
});
02:26
Moderators
30/10/2007
Hello,
afterSubmit event should return array and not a value (see docs). Also to work this
afterSubmit:function reloadGrid(){
jQuery(”#incomelist”).trigger(”reloadGrid”);
return [true,"",""];
}
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:
94 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