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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:09:12+00:00 2026-06-12T08:09:12+00:00

I was looking around for any clues about this problem on SO and found

  • 0

I was looking around for any clues about this problem on SO and found Jqgrid on Edit operation sends “add” as oper=“add” why?. Oleg said that this was a bug and it’s fixed but I am having the same problem using inline edit. I am using jqGrid 4.4.1.

In my case, this problem happens when I add a row, save it then try to edit it. Once I click save to save the changes, the query string has oper=add

Here is my script for reference. I don’t think its pretty as Im still on my 2nd day learning this wonderfull plug-in.

  $(function () {
  var grid = $("#list");

  grid.jqGrid({
      url: "@Url.Action("GetClassList", "Setup")",
      datatype: "json",
      height: 220,
      width: 800,
      colNames: ["Code", "Name", "Duration"],
      colModel: [
            { name: "Code",     index: "Code",      width: 120, editable: true, key: true },
            { name: "Name",     index: "Name",      width: 250, editable: true },
            { name: "Duration", index: "Duration",  width: 120, editable: true }
      ],
      rowNum: 10,
      rowList: [10, 20, 30],
      pager: '#listPager',
      sortname: "Code",
      viewrecords: true,
      sortorder: "desc",
      multiselect: false,
      subGrid: true,
      editurl: "@Url.Action("UpdateClass", "Setup")",
      caption: "Class Information",
      subGridRowExpanded: function(subgrid_id, row_id) {
          var subgrid_table_id, pager_id;
          subgrid_table_id = subgrid_id+"_t";
          pager_id = "p_"+subgrid_table_id;
          $("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table><div id='"+pager_id+"' class='scroll'></div>");

          var classCode = grid.jqGrid("getCell", row_id, "Code");
          var http_get_url = "@Url.Action("GetClassScheduleList", "Setup", new { id = "_CC_PH_" })";
          http_get_url = http_get_url.replace("_CC_PH_", classCode);

          var http_post_url = "@Url.Action("UpdateClassSchedule", "Setup", new { id = "_CC_PH_" })";
          http_post_url = http_post_url.replace("_CC_PH_", classCode);

          jQuery("#"+subgrid_table_id).jqGrid({
              url: http_get_url,
              datatype: "json",
              prmNames: {id: "rid"},
              colNames: ["", "Day", "Start Time", "Block", "Room", "Is Selected"],
              colModel: [
                          { name: "Num",          index: "Num",         width:0,     hidden: true,   key: true },
                          { name: "Day",          index: "Day",         width: 120,                  editable: true, edittype: "select", editoptions: { value: "Sunday:Sunday;Saturday:Saturday;Monday:Monday;Tuesday:Tuesday;Wednesday:Wednesday;Thursday:Thursday;Friday:Friday" }},
                          { name: "Start Time",   index: "Start Time",  width: 120,  align: "right", editable: true},
                          { name: "Block",        index: "Block",       width: 70,   align: "right", editable: true},
                          { name: "Room",         index: "Room",        width: 70,   align: "right", editable: true},
                          { name: "Is Selected",  index: "Is Selected", width: 100,  align: "right", editable: true, edittype: "checkbox", editoptions: { value:"Yes:No" }}
              ],
              rowNum:20,
              pager: pager_id,
              sortname: 'Num',
              sortorder: "asc",
              multiselect: false,
              editurl: http_post_url,
              height: '100%',
          });
          jQuery("#"+subgrid_table_id).jqGrid('navGrid',"#"+pager_id,{edit: false, add: false, del: false, search: false },{reloadAfterSubmit: true})
          jQuery("#"+subgrid_table_id).jqGrid('inlineNav',"#"+pager_id)
        },
        subGridRowColapsed: function(subgrid_id, row_id) {
            // this function is called before removing the data
            //var subgrid_table_id;
            //subgrid_table_id = subgrid_id+"_t";
            //jQuery("#"+subgrid_table_id).remove();
        }
  });
  jQuery("#list").jqGrid('navGrid', "#listPager", { edit: false, add: false, del: false, search: false },{reloadAfterSubmit: true});
  jQuery("#list").jqGrid('inlineNav', "#listPager");

});

  • 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-12T08:09:14+00:00Added an answer on June 12, 2026 at 8:09 am

    try this code

      serializeRowData: function(postData){
    
        // new row id is "new_row"
        postData.oper = postData.id == "new_row" ? "add" : "edit";
        return postData;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been looking around this for a while, but haven't found any clear information.
Looking around the docs I cannot see a correct way to go about this.
I've been looking around and haven't found any examples of using spring annotations to
I've been looking around the web but I've yet to found any information on
I've been looking around here for any reference to a java library for visual
Been looking around a bit and I can't seem to find any help on
So I've been looking around for days now and I can not find any
I'm looking to see if there is any way of getting around type erasure
I was looking for some solution around here and I didnt find any correct
Been looking around and can't find a definite way to do this... I need

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.