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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:18:16+00:00 2026-06-14T14:18:16+00:00

I want to to assign inline edit feature to my jqGrid, i.e when the

  • 0

I want to to assign inline edit feature to my jqGrid, i.e when the cuser clicks a particular row, he should be able to edit..

I am following this url for the jQuery code but its not working, I am not able get edit also

http://www.trirand.com/blog/jqgrid/jqgrid.html#

This is my view

<table id="list"></table>
</table>

JavaScript code:

  <script type="text/javascript">
    $(function () {
        var lastsel;
        jQuery("#list").jqGrid({
            url: '/Home/GetStudents/',
            datatype: 'json',
            mtype: 'POST',
            colNames: ['StudentID', 'FirstName', 'LastName', 'Email'],
            colModel: [
      { name: 'StudentID',sortable: false,key:true },
      { name: 'FirstName' },
      { name: 'LastName', sortable: false},
      { name: 'Email', width: 200,  sortable: false}],
      cmTemplate: {align: 'center', editable: true},
            pager: '#pager',
            width: 750,
            rowNum: 15,
            rowList: [5, 10, 20, 50],
            sortname: 'StudentID',
            sortorder: "asc",
            viewrecords: true,
            caption: ' My First JQgrid',
            onSelectRow: function (StudentID) {


                if (StudentID != lastsel) {

                    lastsel = StudentID;   
                    jQuery('#list').jqGrid('restoreRow', lastsel);
                    jQuery('#list').jqGrid('editRow', StudentID, true);


                }

            },

            editurl: '/Home/GetStudents/',
            caption: "Using events example"

        });
        jQuery("#list").jqGrid('navGrid', "#pager", { edit: false, add: false, del: false });
    });

</script>

These are my scripts, I added

<link href="/Content/jquery-ui-1.8.7.css" rel="stylesheet" type="text/css" />
<link href="/Content/ui.jqgrid.css" rel="stylesheet" type="text/css" />
<link href="/Content/ui.multiselect.css" rel="stylesheet" type="text/css" />
<script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>  
<script src="/Scripts/grid.locale-en.js" type="text/javascript"></script>
<script src="/Scripts/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="/Scripts/rowedex3.js" type="text/javascript"></script>
  • 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-14T14:18:18+00:00Added an answer on June 14, 2026 at 2:18 pm

    First of all you have to define editurl option of jqGrid which will be responsible for processing of saving of row on the server side.

    Next problem: you should define lastsel variable to use if in onSelectRow callback.

    I recommend you additionally default property of colModel items like width: 150 or sortable: true (see the documentation). If you need redefine some default settings for columns of the grid you can use cmTemplate (see here) for additional information. You can reduce colModel from your grid to the following

    colModel: [
            { name: 'StudentID', sortable: false, key: true },
            { name: 'FirstName' },
            { name: 'LastName', sortable: false },
            { name: 'Email', width: 200, sortable: false}],
    cmTemplate: {align: 'center', editable: true}
    

    Such changes will make the code more readable and easy to maintain. I added key: true to be sure that jqGrid use the vale from the column as the rowid. Depend on the format of JSON data which you return it could be not required, but it makes the code in my opinion also more readable and easier to maintain.

    You can additionally remove all attributes of <table> element used for the grid.

    Additionally because of performance reason I would recommend you always use gridview: true option of jqGrid and replace pager: jQuery('#pager') to pager: '#pager'.

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

Sidebar

Related Questions

I want to assign one row of 2d array to 1d array this is
I want to assign the array item into variable directly using groovy like this:
I want to assign a default value if url parameter is not set. Something
i want to assign multiple resources (engineers) to the same sprint. But, not able
I want to assign an array using inline assembly using the AT&T syntax. I
i want to assign a class to an a href tag if this his
i want to assign a multidimensional array to jtree. how can i do this?
I want to assign the decimal variable "trans" to the double variable "this.Opacity". decimal
I want to assign a copy of a boost::multi_array. How can I do this.
I want to assign a value to a variable if a particular attribute returns

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.