jqGrid response after Add/Edit/Delete?

Posted on 2009-12-30
Last Modified: 2013-11-11

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.
Question by:Amar-ms
    LVL 3

    Expert Comment

    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

    document.getElementById("myStatus").innerHTML="Failed to add the record"

    LVL 20

    Expert Comment

    by:Sathish David Kumar N
    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 ....


    Author Comment

    Thanks guys, but what i am looking for is displaying the message on the form pop-up not the actual page.
    LVL 3

    Expert Comment

    then its simple..

    do this in your javascript...

    var status = <your AJAX call response>;

    alert("Your operation failed");
    alert("Your operation completed successfully");

    if you want to do a popup window instead of alert  then you can use

    Author Comment

    want to show it on the form itself not as a alert or a pop-up.
    LVL 3

    Expert Comment

    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!!
    LVL 20

    Accepted Solution

    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 !!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    Title # Comments Views Activity
    count11 challenge 6 30
    parentbit challenge 3 36
    mapShare challenge 13 40
    Jquery remove certain link from page and/or remove text 17 19
    Introduction HyperText Transfer Protocol ( or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now