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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:20:08+00:00 2026-05-14T22:20:08+00:00

I want to have a button in each row to delete the corresponding row.

  • 0

I want to have a button in each row to delete the corresponding row. So I used the samples in the demo page to try to achieve this.

It is working for edit row, but I also want to have a delete button.

Here is my code

jQuery("#detFlex1").jqGrid({
    url: '<%= Html.Encode(ViewData["module"])%>/GetDetailList1',
    datatype: "json",
    altRows: true,
    mtype: 'POST',
    colNames: ['Inv No', 'Actions', '<%= RmdReqVendor.AccountName %>', '<%= RmdReqVendor.AccountNum %>'
                , '<%= RmdReqVendor.Valuta %>'
                , '<%= RmdReqVendor.Country %>'
                , '<%= RmdReqVendor.Branch %>'
                , '<%= RmdReqVendor.BankKey %>'
                , '<%= RmdReqVendor.Priority %>'],
    colModel: [
           { name: 'account_id', index: 'account_id', width: 55, hidden: true },
           { name: 'act', index: 'act', width: 55, sortable: false },
           { name: 'account_name', index: 'account_name', width: 150,editable:true,editoptions:{size:30,maxlength:30}, editrules:{required:true} },
           { name: 'account_num', index: 'account_num', width: 150,editable:true,editoptions:{size:18,maxlength:18}, editrules:{required:true, number:true} },
           { name: 'valuta', index: 'valuta', width: 90, editable: true,edittype:"select",editoptions:{value:"<%= JsHelper.CurrencyJsArray() %>"}, editrules:{required:true} },
           { name: 'country', index: 'country', width: 150, editable: true,edittype:"select",editoptions:{value:"<%= JsHelper.CountryJsArray() %>"}, editrules:{required:true} },
           { name: 'branch', index: 'branch', width: 150,editable:true,editoptions:{size:40,maxlength:40}, editrules:{required:true} },
           { name: 'bank_key', index: 'bank_key', width: 90,editable:true,editoptions:{size:15,maxlength:15}, editrules:{required:false} },
           { name: 'priority', index: 'priority', width: 90,editable:true,editoptions:{size:10,maxlength:10}, editrules:{required:true, number:true} }
       ],
    rowNum: 10,
    rowList: [10, 20, 30],
    pager: '#pagerFlex1',
    sortname: 'request_id',
    viewrecords: true,
    sortorder: "desc",
    caption: '<%= RmdReqVendor.BankAccountTitle %>',
    width: $('.body').width()-40,
    height: 180,
    shrinkToFit: false,
    gridComplete: function(){
        var ids = jQuery("#detFlex1").jqGrid('getDataIDs');
        for(var i=0;i < ids.length;i++){
            var cl = ids[i];
            be = "<button style='height:22px;width:20px;' type='button' title='Edit' onclick="jQuery('#detFlex1').jqGrid('editGridRow','"+cl+"',{top:top,left:left,width:420,height:220,reloadAfterSubmit:false,addedrow:'last',bSubmit:'Add' });" >E</button>";
            de = "<button style='height:22px;width:20px;' type='button' title='Delete' onclick="jQuery('#detFlex1').jqGrid('delGridRow','"+cl+"',{reloadAfterSubmit:false });" >D</button>";
            jQuery("#detFlex1").jqGrid('setRowData',ids[i],{act:be+de});
        }
    },
    editurl: "<%= Html.Encode(ViewData["module"])%>/SaveDetail1"

});
jQuery("#detFlex1").jqGrid('navGrid', '#pagerFlex1', { edit: false, add: false, del: false, search: false, refresh: false });

The edit button works wonderful, but the delete button is not.

The delete button when clicked, only makes a gray mask over the entire page, and not showing the delete confirmation dialog

What am I missing here?

  • 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-14T22:20:09+00:00Added an answer on May 14, 2026 at 10:20 pm

    shouldn’t you do this?

            be = "<button style='height:22px;width:20px;' type='button' title='Edit' onclick=\"jQuery('#detFlex1').jqGrid('editGridRow','"+cl+"',{top:top,left:left,width:420,height:220,reloadAfterSubmit:false,addedrow:'last',bSubmit:'Add' });\" >E</button>";
            de = "<button style='height:22px;width:20px;' type='button' title='Delete' onclick=\"jQuery('#detFlex1').jqGrid('delGridRow','"+cl+"',{reloadAfterSubmit:false });\" >D</button>";
    

    (backslashes on the qoutes before and after the onclick event.)

    I copied your method in my jqgrid (i dont delete in that grid normal) and it worked if i putted the backslashes. I got the delete confirmation dialog.

    But it’s strange that the edit button works correctly without those backslashes…

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

Sidebar

Related Questions

I have a delete button in each row of GridView (component ASP.NET). I want
I have a search page that loads results. Each row has a Delete button
I have a gridview control with delete asp:ImageButton for each row of the grid.
I want to have a button on my toolbar that has a little down
I have a Login button that I want to be disabled until 3 text
I have a datalist control which some controls(ex: button) are in it. I want
I have the following markup, and I want to make the All radio button
I have a CALayer with some image contents. When a button touched, I want
I have several wpf pages with update/delete/add buttons. I want to display to the
Here's the scenario: I have a set of buttons that I want to bind

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.