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

  • Home
  • SEARCH
  • 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 8348077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:34:52+00:00 2026-06-09T07:34:52+00:00

In inline mode I add a new row, Edit new value, then click the

  • 0

In inline mode I add a new row, Edit new value, then click the ‘save’ button to server and local. However, when I continue to click the ‘edit’ button to edit the new row instead of editing the row it adds a new one. For example, first I add a new row : { aa,bb,cc}, then want to change it to { aaaa,bb,cc} by clicking the ‘edit’ button and editing it, but jqGrid sends an oper=add to the server, this leads to an add new row. I don’t understand why?

code as follow:

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0   Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ddddd</title>
<link
href="/education2/jqGrid4.4/themes/redmond/jquery-ui-1.8.2.custom.css"
rel="Stylesheet" />
<link href="/education2/jqGrid4.4/themes/ui.jqgrid.css" rel="Stylesheet" />
<script src="/education2/jqGrid4.4/js/jquery-1.7.2.js"
type="text/javascript"></script>
<script type="text/javascript"
src="/education2/jqGrid4.4/js/jquery-ui-1.8.2.custom.min.js"></script>
<script type="text/javascript"
src="/education2/jqGrid4.4/js/i18n/grid.locale-cn.js"></script>

<script src="/education2/jqGrid4.4/js/jquery.jqGrid.src.js"
type="text/javascript"></script>

<script type="text/javascript">
jQuery(document).ready(function() {
    jQuery("#gridTable").jqGrid({
        url : '/education2/json/searchStudent',
        mtype : "POST",
        datatype : "json",
        colNames : [ 'studentId','studentNo', 'name', 'class'],
        colModel : [ {
            name : 'studentId',
            index : 'studentId',
            width : 55,
            hidden : true,
            hidedlg : true
            key : true,
            editable : true
        }, {
            name : 'studentNo',
            index : 'studentNo',
            width : 150,
            editable : true         
        }, {
            name : 'studentName',
            index : 'studentName',
            width : 150,
            align : "right",
            editable : true
        }, {
            name : 'className',
            index : 'className',
            width : 150,
            align : "right",
            editable : true,
            edittype : 'select',
            editoptions : {
                dataUrl : "/education2/json/classNameStudent"
            }   
        }],
        jsonReader : {
            root : "gridModel",
            records : "record",
            repeatitems : false
        },
        prmNames : {
            search : "search",
            id : "id" 
        },
        rowNum : 10,
        rowList : [ 10, 20, 30 ],
        height : 400,
        //          multiselect : true,
        //          multiboxonly : true,
        pager : jQuery('#gridPager'),
        sortname : 'studentId',
        viewrecords : true,
        altRows : true,
        sortorder : "desc",
        editurl : "/education2/json/editStudent",
        caption : "student"
    });

    jQuery("#gridTable").jqGrid('navGrid', "#gridPager", {
        edit : false,
        add : false,
        del : true
    }, {}, {}, {}, {
        caption : "find",
        Find : "find",
        closeAfterSearch : true
    });

    jQuery("#gridTable").jqGrid('inlineNav', "#gridPager", {

        editParams : {
            successfunc : succesfunc1,
            restoreAfterError : false
        }
    });
});

var succesfunc1 = function(response) {
    var result = eval('(' + response.responseText + ')');
    if (result.success == true) {
        alert("success!");
        return true;
    } else {
        alert(result.message);
        return false;
    }
};


};
</script>
</head>
<body>

<table id="gridTable"></table>
<div id="gridPager"></div>
<br />

</body>
</html>

UPDATE

I use $('#'+$.jgrid.jpID(rowid).attr('id', result1.new_id) to refresh row id of the new row (idea from @oleg in question “how to update column after inline add in jqGrid”), and on the server I use oper=new && id !="new_row" to decide if it should be an edit or add a new row. It runs well, but I must add an aftersavefunc method.

The question above isn’t well understood by me. What I do is only bypass the question.

My problem is that I: add a new row then change it, jqgrid doesn’t change it, jqgrid sends an "oper=add" to server, this means the server will add a new row.

Another question is:

jQuery("#gridTable").jqGrid('inlineNav', "#gridPager", {

    addParams : {
        addRowParams : {
            keys : true,
            url : '/education2/json/editStudent1?inlinePoer=add'
        }
    },
    editParams : {
        url : '/education2/json/editStudent?inlinePoer=edit',
    }
});

Unlike I expect, whenever I click add, edit or the save button in inline navigator, only the url : '/education2/json/editStudent?inlinePoer=edit' is fired. It seems url : '/education2/json/editStudent1?inlinePoer=add' cannot be fired, why? Could somebody help me?

I use firebug, and IE.

  • 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-09T07:34:54+00:00Added an answer on June 9, 2026 at 7:34 am

    I think what you are missing is giving edit:true in following line

    jQuery("#gridTable").jqGrid('inlineNav', "#gridPager", {
    
            editParams : {
                successfunc : succesfunc1,
                restoreAfterError : false
            }
        });
    

    check this link

    http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing#inlinenav and look at the parameters here. I’m not sure about it just try to give edit as true, if it works fine, great…else i’ll look into your code when i’ll be done with my office work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

jQgrid row is edited using inline editing mode. Pressing Enter sends data to server
Inline editing is started using edit formatter action button. If clicked in other row,
My requirement is, If I click a row in jqgrid with inline edit feature.
jqGrid inline edit starts on single in click by onSelectRow event below. Save and
jqGrid contains quantity column and add to cart button using colmodel below. Inline editing
In inline editing mode, clicking on Save is throwing an error. var rowSave =
I am using the jquery ui datepicker inline mode view I want to be
I'm currently using inline javascript to clear an input text's default value on focus.
While we can add Inline Images in paragraphs there does not appear to be
I am using jqgrid and using the inline editing mode and can't figure out

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.