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 7849715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:36:52+00:00 2026-06-02T18:36:52+00:00

I am having a bit of a problem with this fantastic jqgrid plugin and

  • 0

I am having a bit of a problem with this fantastic jqgrid plugin and my attempt to use it with WCF Data Services (not really, but the very similar odata4j services).
By the way, if anyone is thinking about using jqgrid with odata services, please send me a line, I found answers to difficult questions like, for example, how to configure the grid xmlreader to read an odata xml structure defeating the jquery namespace search issue (
hints:

include jquery.xmlns.js

.....
$.xmlns.m = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";
$.xmlns.d = "http://schemas.microsoft.com/ado/2007/08/dataservices";
.....
var feedXmlReaderOptions = {
    root: "feed",
    row: "entry",
    repeatitems: false,
    id: "feed>entry>id"
};
....
    colModel: [
    {
        name: "clmNumKey", 
        index: "clmNumKey", 
        width: 150, 
        xmlmap: "d|clmNum",
        editable: true
    }
    ....
)

Anyway, the issue is that odata services need the method that addresses the edit operation (DELETE, PUT, MERGE) to be sent as a custom request header on a normal POST, rather than it being an http method. The reason for that seems to be that most firewalls do not allow PUT and DELETE http methods to pass, because that is how you can, for example, place new files on the server, as well as delete files, in case you can guess the valid path.
Long story short…the loadBeforeSend event is not triggered for inline or form edit…I can see it being triggered on a full data request of the grid, but I only get the serializeEditData event triggered when I submit from the edit form.
I am worried because I went into the jqgrid source files (grid.formedit.js, grid.inlineedit.js) and I couldn’t get any hits with the beforesend keywords, only serializeeditdata is showing there.
Am I missing something?
Is there another way to set the headers I need on the xhr ajax object the grid uses? Is that xhr object exposed by the grid?

Below you have the code I have to handle the edit events…again, the loadBeforeSend is not triggered…

Thank you in advance,
Serban

$.extend($.jgrid.edit, {
    closeAfterEdit: true,
    closeAfterAdd: true,
    ajaxEditOptions: {
        contentType: "application/json"
    },
    mtype: 'POST',
    loadBeforeSend: function(xhr)
    {
        xhr.setRequestHeader("X-HTTP-Method", "MERGE");
        return xhr;
    },        
    serializeEditData: function (data) {
        delete data.oper;
        return JSON.stringify(data);
    }
});                                                  
  • 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-02T18:36:54+00:00Added an answer on June 2, 2026 at 6:36 pm

    There are no loadBeforeSend parameter which you can set by $.jgrid.edit. The values from $.jgrid.edit defines default options of editGridRow.

    To specify the loadBeforeSend callback which should be used during the corresponding Ajax request you should use ajaxEditOptions instead and specify beforeSend (see $.ajax):

    $.extend($.jgrid.edit, {
        closeAfterEdit: true,
        closeAfterAdd: true,
        ajaxEditOptions: {
            contentType: "application/json",
            beforeSend: function (jqXHR, settings) {
                jqXHR.setRequestHeader("X-HTTP-Method", "MERGE");
            }
        },
        //mtype: 'POST', - it's already default
        serializeEditData: function (data) {
            delete data.oper;
            return JSON.stringify(data);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know I've come across this problem before, but I'm having a bit of
I am having a problem with bit of code. This is the code $test
Having a bit of a problem, Due to the source-control set-up we use, each
I'm having a bit of a problem with this code. The program gives me
i'm having a bit of a problem here. I found this script on the
Im having a bit of a problem with this code each time i execute
I am having a bit of a brain block with this problem and I
Hello having a bit of problem retrieving a value so i might use it.
Hello im having a bit of a problem, look at this: SELECT id, activate_key
I'm having a bit of a problem with this. I wanted to make a

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.