Forum


19:31

12/12/2009

I read docuemntation about afterSbmit event but I did not understand howto to manage the output result script of server.
For example, when I add a record the editurl cgi is ivoked and I can see ( in php script, that in the _REQUEST (alway) and in the _POST or _GET array (mytype parameter)) the operation request (add, search, del ecc.).
The afterSubmit has the return call with success message and id variable. How can I to connect the output cgi (editurl parameter) with afterSubmit?
I wish I could manage and to view the return message of editurl script in the form. Exmple : "Record inserted without errors" or
"Record not inserted ID already in archive", ecc.
Thanks in advance.
Giovanni.
11:01

Moderators
30/10/2007

Hello,
afterSubmit : function (resp, postdata)
{
// you should return from server OK in sucess, any other message on error
if(resp.responseText == "OK")
{
alert("Update is succefully")
return [true,"",""]
}
else {
alert("Update failed")
return [true,"",""]
}
}
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.
19:05

Moderators
30/10/2007

Hello,
Sorry not possible for now. What I do common in my applications is to call a custom function on succes whisc displays the message at bootom top screen for some time and the disappear.
Look here to have a idea:
http://jqueryui.com/demos/effect/
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.
00:38

12/12/2009

Hello,
when, for example, I submit the data from edit form, the editurl script can return the "OK" string, or a message error.
afterSubmit : function (resp, postdata)
{
// you should return from server OK in sucess, any other message on error
var message = resp.responseText
if(message == “OK”)
return [true,"",""]
else
return [false, message, ""]
}
If I have a message error the form remains in open state and I can read on the top of form the message error, change the data and submit the data to server again.
If I have not error the form is clean, the main grid is update and I can do other operations.
Regarsd.
Giovanni.
Most Users Ever Online: 715
Currently Online:
63 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