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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:39:57+00:00 2026-05-17T18:39:57+00:00

I am trying to customize the delete function in jqGrid. I have enabled the

  • 0

I am trying to customize the delete function in jqGrid.

I have enabled the delete button on the grid

$("#myGrid").jqGrid('navGrid', '#pager',
    { add: true, addtitle: 'Add Customer',
        edit: true, edittitle: 'Edit Customer',
        del: true, deltitle: 'Delete Customer',
        refresh: true, refreshtitle: 'Refresh data',
        search: true, searchtitle: 'Apply filters', 
        addfunc: addForo, editfunc: editForo, 
        cloneToTop: true
    },
    {}, // default settings for edit
    {}, // default settings for add
    {}, // default settings for delete
    { closeOnEscape: true, multipleSearch: true, closeAfterSearch: true }, // search options
    {} // default settings for view
);

then I have added (thanks to this post) the following code

$("#bDelete").click(function () {
    // Get the currently selected row
    toDelete = $("#myGrid").jqGrid('getGridParam', 'selrow');
    $("#myGrid").jqGrid(
        'delGridRow',
        toDelete,
        { url: '/Foro/Delete/' + toDelete, mtype: 'post', reloadAfterSubmit: false }
    );
});

Now when I click on the delete button a dialog is shown asking for delete confirm. But if I click on the delete button I will get the following error message

alt text

Where am I wrong?

  • 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-17T18:39:58+00:00Added an answer on May 17, 2026 at 6:39 pm

    If I understand you correct you want to modify the url used to delete of row so that the id of the row will be a part of the url. You can do this much easier:

    $("#myGrid").jqGrid('navGrid', '#pager',
        // define navGrid options and paraneters of Edit and Add dialogs
        { // now define settings for Delete dialog
          mtype: "POST", reloadAfterSubmit: false,
          onclickSubmit: function(rp_ge, postdata) {
              rp_ge.url = '/Foro/Delete/'+ postdata;
          },
          serializeDelData: function (postdata) { return ""; }
        },
        // search options
        // ...
    );
    

    With respect of onclickSubmit we can modify the url and defining of serializeDelData we can clear the body of the “POST” message. I peronally mostly use RESTfull services on the server side and use mtype: "DELETE". In the case to clear of the body is really needed.

    One more option is to use delfunc like you already use editfunc and addfunc. In the most cases the usage of such function is not really needed and one can implement the same in other way.

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

Sidebar

Related Questions

I'm trying to customize some TFS work items via the VS2008 xml editor, but
Trying to make a make generic select control that I can dynamically add elements
I am trying to customize the DispForm.aspx Display form in an announcement list but
I am trying to customize the Sitecore Page Editor at a website. Their home
I'm trying to customize a lightbox script (prototype) to make it resize images that
I am trying to customize the webif v. 0.3-4895 package on openwrt-10.03.1-rc3 (backfire). I
I'm newbie in WiX and trying to customize dialog queue by adding the new
I am trying to develop a Customize TabControl in which I'll divide the Whole
I'm trying to generate customized xml files from a template xml file in python.
Trying to setup an SSH server on Windows Server 2003. What are some good

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.