title: jqGrid Delete a Row
body: <p>I have created my grid and would like to use default behaviour of the grid to delete a row.</p>
  
  <p>This is my grid setup code:</p>
  
  <pre><code>$("#grid").jqGrid('navGrid', '#grid_pager',
      { add: true, addtitle: 'Add Customer', 
        edit: true, edittitle: 'Edit Customer',
        del: true, deltitle: 'Delete Customer', 
        refresh: true, refreshtitle: 'Refresh data',
        search: true, searchtitle: 'Advanced search filters', 
        addfunc: addReferent, editfunc: editReferent
      },
      {}, // default settings for edit
      {}, // default settings for add
      { // define settings for Delete 
          mtype: "post", 
          reloadAfterSubmit: true,
          url: wsBaseUrl + 'CustomerService.asmx/DeleteCustomer',
          resize: false,
          serializeDelData: function(postdata) {
              return JSON.stringify({ customerID: postdata.id });
          }
      },
      { // define settings for search
          closeOnEscape: true, multipleSearch: true, closeAfterSearch: true 
      }, 
      {}
  );
  </code></pre>
  
  <p>and this is the web service method defined on the server</p>
  
  <pre><code>[WebMethod]
  public OperationResult Deletecustomer(string customerID)
  {
  }
  </code></pre>
  
  <p>but unfortunately when I click the delete button and click ok on the confirm window I get an error saying 404. as in the following picture</p>
  
  <p><img src="https://i.stack.imgur.com/S1bso.png" alt="Error screenshot"></p>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I have added the following code to my jqGrid Initialization </p>
  
  <pre><code>// Set defaults value for jqGrid
  $.jgrid.defaults = $.extend($.jgrid.defaults, {
      mtype: 'post',
      datatype: 'json',
      jsonReader: {
          root: "d.Rows",
          page: "d.Page",
          total: "d.Total",
          records: "d.Records",
          repeatitems: false,
          userdata: "d.UserData",
          id: "Id"
      },
      ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
      serializeGridData: function (postData) {
          return JSON.stringify(postData);
      },
      ajaxDelOptions: { contentType: 'application/json; charset=utf-8' },
      serializeDelData: function (postData) {
          return JSON.stringify(postData);
      },
      loadui: "block",
      multiboxonly: true,
      rowNum: 25,
      rowList: [25, 50, 100],
      altRows: true,
      altclass: 'ui-priority-secondary',
      autoencode: true,
      autowidth: true,
      rownumbers: true,
      rownumWidth: 30,
      gridview: true,
      hoverrows: true,
      viewrecords: true
  });
  </code></pre>
  
  <p>but I still get the same error...</p>