[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5908
  • Last Modified:

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.
0
Amar-ms
Asked:
Amar-ms
  • 3
  • 2
  • 2
1 Solution
 
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 NCommented:
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
 
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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
 
Sathish David Kumar NCommented:
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now