Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8806815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:13:10+00:00 2026-06-14T02:13:10+00:00

I am returning a JSON value called insertStatus and I’d like to get it

  • 0

I am returning a JSON value called insertStatus and I’d like to get it from the function aftersubmit which I have as it follows:

var addOptions = 
      
      { 
          closeOnEscape: true,
          width:500,
          url: 'addMember', 
          savekey: [true, 13],
          afterSubmit : function(response, postdata) 
          { 
              alert(response.insertStatus);
          },
          resize : false,
          closeAfterAdd: true
      };
  

But I will just display the message "undefined".

I am trying to get the value of InsertStatus as JSON because this value will tell me if the insert of the new record was successfully saved to the Database or not. Maybe I should follow another approach if I cannot get the JSON value from here?

I used errorText before for another task and instead of returning a JSON value I returned an HTTP error status with a custom error message. Which would be the best approach? Even if the second approach was better I’d really like to know the answer of the first one. Thanks for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:13:12+00:00Added an answer on June 14, 2026 at 2:13 am

    Form editing module of jqGrid uses complete callback of jQuery.ajax instead of typical success callback (see the source code). So the first parameter of afterSubmit callback (the response parameter) is object which will be named in jqGrid documentation as jqXHR. It’s extension of XMLHttpRequest. So you should use responseText property to access the plain response from the server. If the server return object with insertStatus encoded as JSON string then you have to parse JSON string response.responseText first and only then get insertStatus property. The corresponding code of afterSubmit can be about the following:

    afterSubmit: function (response, postdata) {
        var res = $.parseJSON(response.responseText);
        if (res && res.insertStatus) {
            alert(res.insertStatus);
        }
        // you should don't forget to return
        //     return [true, ""];
        // in case of successful editing and return
        //     return [true, "", newId];
        // with the Id of new row generated from the server
        // if you would use reloadAfterSubmit: false
        // option of editGridRow
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a controller returning a json structure like so: def show # .......
Android programming. I have a json returning the date from a database as a
I am accessing a service that is returning json as follows: { A:A value,
I have an AJAX call returning JSON like... { 490: A, 675: B, 491:
I'm returning JSON from my controller to my view in order to populate a
Why does my cfc method (when returning JSON format or called via remoting) return
I have Json returning as the following: [{CreatedBy:GIS_DB,CreatedDate:3/8/2012 10:44:00 AM,Id:39,ModifiedBy:,ModifiedDate:,Name:CF-39,StatusId:1,TrailCoordinates:[{CreatedBy:GIS_DB,CreatedDate:3/8/2012 10:44:00 AM,Id:1637,Latitude:32.76004207,Longitude:-97.34006853,ModifiedBy:,ModifiedDate:,SortOrder:1,TrailId:39},{CreatedBy:GIS_DB,CreatedDate:3/8/2012 10:44:00 AM,Id:1638,Latitude:32.76004333,Longitude:-97.34012121,ModifiedBy:,ModifiedDate:,SortOrder:2,TrailId:39}]},{CreatedBy:GIS_DB,CreatedDate:3/8/2012
I am developing some REST API's which are returning data in json format. ASP.net
I'm working on a rake task which imports from a JSON feed into an
I have the following php script that is called by jquery ajax function report_range($time,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.