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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:40:09+00:00 2026-05-31T16:40:09+00:00

After long searches, I succeed to delete a row in a jqgrid with form

  • 0

After long searches, I succeed to delete a row in a jqgrid with form editing.

But, there are two little things left :

  • How to reload the grid with the row deleted ?
  • If the row can’t be deleted, how to display the information and the reason why ?

I tried to search in the arguments passed to the function in the event “afterSubmit”, but there is no real explanations about how to manipulate these arguments.

The creation of the grid :

tableToGrid("#TabUser", {
    caption: 'Gestion des Utilisateurs',
    width: 'auto',
    height: "auto",
    hidegrid: false,
    pager:'#DivUser',
    rowNum:10,
    cellEdit: true,
    cellsubmit: 'remote',
    cellurl: 'Adminuser',
    colModel: [{name:'Id', editable:false, width:50},
               {name:'Login', editable:false, width:150},
               {name:'Nom', editable:true, width:200},
               {name:'Prénom', editable:true, width:200},
               {name:'Rôle', editable:true, width:80, edittype:'select', 
                editoptions: { multiple: false, value:{ADMIN:'ADMIN',GUEST:'GUEST'}}},
               {name:'Email', editable:true, width:200}],
    beforeSubmitCell: function(rowid, celname, value, iRow, iCol) {
        var rowData = jQuery(this).getRowData(rowid); 
        var idUser= rowData['Id'];// On récupère l'Id du user en cours d'édition
        return {idUser:idUser}; }

});

The navigation :

$("#TabUser").navGrid('#DivUser',
        {edit:false,add:false,del:true,search:false},{}, {},
        {width:500, url:'Adminuser',
            reloadAfterSubmit:true,
             onclickSubmit: function(param){ 
                var sr = jQuery('#TabUser').getGridParam('selrow');
                var idUser = jQuery('#TabUser').getCell(sr,'Id');
                return {idUser:idUser}; },
            afterSubmit: function(reponse, data) {
                $("#TabUser").trigger('reloadGrid');
                $("#eData").click(); // clic sur "Annuler"
                return [true,"Supression réussie"];
            }
        });

What are the values of “response” and “data” ?
How to reload the grid ?

The row is effectively deleted in the database with the url ‘Adminuser’ (written in java).

  • 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-05-31T16:40:11+00:00Added an answer on May 31, 2026 at 4:40 pm

    I think that your real problem is not reloading of the grid after deleting of the row. The grid which will be created by tableToGrid have datatype: 'local' and reloading of data from the server not needed.

    Your real problem is the bug in jqGrid 3.4.1 which is fixed (see here) in the code of jqGrid. So the deleted row will be not removed from the grid. The problem is the line of code:

    toarr = postdata.split(",");
    

    The bug is that postdata is already array and not the string. So one get exception in the line and the next lines which delete the row from the grid will be not executed. To fix the problem you can either use the last version of the jqGrid code from the github or to modify the above line (it has line number 8282 in jquery.jqGrid.src.js) to

    toarr = postdata;
    

    or download the modified version of jquery.jqGrid.src.js here. After that you can remove the line with $("#TabUser").trigger('reloadGrid'); from your code and all will work correctly: see the demo.

    To report the error information from the server in the “Delete” of the row you should just set error status code in the HTTP response. You can additionally define the errorTextFormat callback which reformat the server response to the HTML code fragment which you want to display as the error message. See the answer, this one or this for additional information.

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

Sidebar

Related Questions

I'm using drupal and a pgsql database, but after long searches I still can't
This might not be a programming question but I am posting it after long
After a long search I'm still confused about it although I found some related
After a long time searching and trying I'm asking now for help: My situation:
After a long investigation on how to use TFS 2010 I started with the
How long after a document is fed to the Google Search Appliance using a
I am returning to C++ after a long absence and I am stumbling a
I'm currently re-engaging with Python after a long absence and loving it. However, I
I'm getting back in to Cocoa development on the Mac after a long stint
After searching a long time for a performance bug, I read about denormal floating

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.