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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:53:45+00:00 2026-06-07T19:53:45+00:00

I have a JQGrid that has the custom setup fro editing and saving row

  • 0

I have a JQGrid that has the custom setup fro editing and saving row data changes I am however a little confused. The data from my select does not appear in my post and I can select another row while editing a row which changes the value of the currently selected row and throws a bug into the editing process.

$.ajax({
    type: 'POST',
    url: '/myserver/myservice.asmx/GetMyData',
    contentType: 'application/json; charset=utf-8',
    dataType: 'json',
    data: params
}).success(function(data) {
    clearNotSatisifiedConcessionList();
    var rowid;
    var response = data.d;
    if (response.length > 0) {
        $('p.infotext').html('<span class="ui-icon ui-icon-info"></span><strong>Information: </strong>Click a row, then click <b><i>Edit</i></b>');
        var lastsel2;
        var grid = $("#myList").jqGrid({
            datatype: "local",
            data: response,
            height: '100%',
            autowidth: true,
            hidegrid: false,
            ajaxSelectOptions: { type: "POST", contentType: 'application/json; charset=utf-8', dataType: 'json' },
            colNames: ['ID', 'Date', 'col1', 'col2', 'col3'],
            colModel: [
                { name: 'ID', index: 'ID', width: 20 },
                { name: 'Date', index: 'Date', width: 30, sorttype: 'date', formatter: 'date', formatoptions: { srcformat: 'd/m/Y', newformat: 'd/m/Y' }, datefmt: 'd/m/Y' },
                { name: 'col1', index: 'col1', width: 20 },
                { name: 'col2', index: 'col2', width: 25, sorttype: 'int' },
                { name: 'col3', index: 'col3', width: 35, sorttype: 'int' }
            ],
            pager: '#MyPager',
            rowNum: 15,
            editurl: '/myserver/myservice.asmx/SaveMyData',
            editData : {"SmodifiedByPersonRef":getCurrentUserPersonRef(), "modifiedByPostRef": getCurrentUserPostRef()},
            sortname: 'Date',
            sortorder: 'desc',
            viewrecords: true,
            gridview: true,
            caption: ''
        });
    } else {
        clearList();
        $('p.infotext').html('<span class="ui-icon ui-icon-info"></span><strong>Information: </strong>No data found');
    }
}).error(function(jqXHR, textStatus, errorThrown) {
    errorHandler(errorThrown, 'List', 'Load  List');
});

this is my list above my edit select and cancel functions

$("#editRow").click(function(event) {
    event.preventDefault();
    var selectedRow = $('#myList').jqGrid('getGridParam', 'selrow');
    if (selectedRow === null) {
        alert('No row Selected!');
    }else {
        $("#myList").jqGrid('editRow', selectedRow);
        $(".editButton").hide();
        $(".saveButton").show();
        $(".cancelButton").show();    
    }
});

$("#saveRow").click(function(event) {
    event.preventDefault();
    var selectedRow = $('#myList').jqGrid('getGridParam', 'selrow');
    var coincessionId = $("#myList").getCell(selectedRow, "ID");
    $("#myList").jqGrid('saveRow', coincessionId);
    $(".saveButton").hide();
    $(".cancelButton").hide();
    $(".editButton").show();
});

$("#cancelEdit").click(function(event) {
    event.preventDefault();
    var selectedRow = $('#myList').jqGrid('getGridParam', 'selrow');
    $("#myList").jqGrid('restoreRow', selectedRow);
    $(".saveButton").hide();
    $(".cancelButton").hide();
    $(".editButton").show();
});

has anyone done similar with a solution as trawling the internet has not yet provided me with an answer, any questions or comments please don’t hesitate to ask, but please take into account this code has many edits due to the nature of the application which this list will appear within.

  • 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-07T19:53:47+00:00Added an answer on June 7, 2026 at 7:53 pm

    I have added handlers that upon edit add the rowid to a window variable and this variable is checked upon cancel and save making sure the row that is currently selected is the row that was originally selected this seems to work, but is a loose work around

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

Sidebar

Related Questions

I have a jqgrid in a modal popup that has data dependent on some
I have a jqgrid with a subgrid that has one row. Right now every
I have a load once jqgrid that uses a custom formatter to display checkboxes
I have some data from JQGrid that should be exported to excel. So, we
I have a jqGrid in grouping mode that works fine on initial load. However,
I have a jqgrid, where it has a custom formatter to column1. I need
I have a jqGrid that has add/edit dialogs with a form that's longer than
I have a jqgrid that has a subgrid. How can I expand the subgrid
I have a Jqgrid which has datatype as local. I am loading data at
In my jqgrid, I have a cell that has link in it.Currently when the

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.