Forum


11:42

08/06/2011

I am using a form editing in jqgrid. While editing a row using editUrl afterSubmit events is working fine. but at the time of adding a row its not getting fired.
(I am using a server side validations for form editing. i have to check the response and show the message according to the response of the add function. in case of editing this is working fine. In case of add the form gets closed)
$("#admingrid19").jqGrid({
url: basepath+'admins/json_dosimage_list/',
datatype: "json",
colNames:['','DOS Image', 'Status'],
colModel:[
{name:'id', index:'id', width: colWidth1, align:"left", sortable: false},
{name:'name', index:'name', width: colWidth2, align:"left", sortable:true,editoptions:{maxlength:30}, editable : true, editrules:{required:true}},
{name:'status', index:'status', width: colWidth3, align:"left", sortable:true}
],
----
-----
----
----,
caption: strDosImageDescription,
editurl:basepath + "dosimage/add"
}).navGrid("#adminpager19",{edit:true,edittext:'<span class=gridpagerbutton>Edit</span>',add:true,addtext:'<span class=gridpagerbutton>Add</span>',del:false,search:false,refreshtext:'<span class=gridpagerbutton>Refresh</span>'},{reloadAfterSubmit: true, closeOnEscape: true, closeAfterEdit: true,
afterSubmit: function(response, postdata) {
if (response.responseText == "success") {
jQuery("#success").html("DOS image updated sucessfully.");
return [true,''];
}
else if (response.responseText == "duplicate") {
return [false, 'This DOS image already exists.'];
}
else{
return[false, 'Only alphabets are allowed.'];
}
}}
)
Thanks in Advance!!!!!
Most Users Ever Online: 715
Currently Online:
39 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