jqGrid response after Add/Edit/Delete?

Hi,

I am trying to use the jqGrid +jQuery with edit, add, delete can i display a message on the grid, whether the save/update/delete was successful or not?

an java/spring example would be perfect.
Amar-msAsked:
Who is Participating?
 
Sathish David Kumar NArchitectCommented:
what ever ur popup form also u can set the inerHML value ....


do one thing put ur msg in session scope in ur controller  where u need u can dispaly the variable !!

0
 
Nithyanandhan_TCommented:
You needn't do any Java/Spring logic. You will be doing add/update/delete operation in the AJAX call(may be using Jquery) ..
1) Place a <DIV it="myStatus"> just above the table, which can display your add/update/delete status
2) Based on the response of your AJAX call, decide your message

for example if AJAX call failed for ADD

if(failed){
document.getElementById("myStatus").innerHTML="Failed to add the record"
}

0
 
Sathish David Kumar NArchitectCommented:
As Nithyanandhan said is correct !!

ur using jGrid define in jsp that time u can define the div tag ....


Other wise u can set msg (succes or failer ) in ur controller at request scope

and u can get the  resuest scope variable in JSP using JSTL tag ....

0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Amar-msAuthor Commented:
Thanks guys, but what i am looking for is displaying the message on the form pop-up not the actual page.
0
 
Nithyanandhan_TCommented:
then its simple..

do this in your javascript...

var status = <your AJAX call response>;

if(status){
alert("Your operation failed");
}else{
alert("Your operation completed successfully");
}

if you want to do a popup window instead of alert  then you can use window.open
0
 
Amar-msAuthor Commented:
want to show it on the form itself not as a alert or a pop-up.
0
 
Nithyanandhan_TCommented:
what do you mean by "form itself"?
Early you have mentioned "form pop-up"...

Do you have a form in a pop-up and want to display the message there? In that case you can do the same logic which I mentioned... using <DIV>
logic doesn't change based on your target place for message display...

Please make your statements clear.. it will save both of our time!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.