jqGrid (Delete row) - How to send additional POST data???

Posted by ronanray on Stack Overflow See other posts from Stack Overflow or by ronanray
Published on 2010-05-14T10:00:33Z Indexed on 2010/05/14 10:04 UTC
Read the original article Hit count: 1595

Filed under:
|

Hi experts,

I'm having problem with jqGrid delete mechanism as it only send "oper" and "id" parameters in form of POST data (id is the primary key of the table).

The problem is, I need to delete a row based on the id and another column value, let's say user_id. How to add this user_id to the POST data???

I can summarize the issue as the following:

  1. How to get the cell value (user_id) of the selected row?
  2. AND, how to add that user_id to the POST data so it can be retrieved from the code behind where the actual delete process takes place.

Sample codes:

jQuery("#tags").jqGrid({

             url: "subgrid.process.php,
             editurl: "subgrid.process.php?,
             datatype: "json",
             mtype: "POST",
             colNames:['id','user_id','status_type_id'],
             colModel:[{name:'id', index:'id', width:100, editable:true},
                        {name:'user_id', index:'user_id', width:200, editable:true},

                        {name:'status_type_id', index:'status_type_id', width:200}
            ],
             pager: '#pagernav2',
             rowNum:10,
             rowList:[10,20,30,40,50,100],
             sortname: 'id',
             sortorder: "asc",
             caption: "Test",
             height: 200
          });
          jQuery("#tags").jqGrid('navGrid','#pagernav2',
              {add:true,edit:false,del:true,search:false},
              {},
             {mtype:"POST",closeAfterAdd:true,reloadAfterSubmit:true}, // add options
     {mtype:"POST",reloadAfterSubmit:true}, // del options
              {} // search options
          );

Help....

© Stack Overflow or respective owner

Related posts about jqgrid

Related posts about jQuery