jqGrid Delete a Row

前端 未结 1 606
北恋
北恋 2021-01-25 16:36

I have created my grid and would like to use default behaviour of the grid to delete a row.

This is my grid setup code:

$(\"#grid\").jqGrid(\'navGrid\',          


        
相关标签:
1条回答
  • 2021-01-25 17:12

    Probably you should just use JSON.stringify (from json2.js) inside of serializeDelData. You don't posted the prototype of your web method DeleteCustomer which you need to delete, but probably your problem could be fixed with the following code:

    serializeDelData: function(postdata) {
        return JSON.stringify({customerID: postdata.id});
    }
    

    One more common problem in case of the usage of ASMX services. It can be need to define all parameters of the web method called (see here an example).

    The usage of ajaxDelOptions: { contentType: "application/json" } parameter is also required mostly.

    It can be helpful to use Fiddler or Firebug to capture and analyse the HTTP traffic.

    0 讨论(0)
提交回复
热议问题