Search code examples
javascriptphpjqgrid

extra parameters in delete action of JQgrid


I want to pass extra parameters like action=delete

jQuery(grid_selector).jqGrid({
        url: '<?php echo A_CLIENT_URL?>/getClientAppointment/<?= $userdata['U_ID']?>',
        datatype: "json",
        mtype: 'POST',
        colNames:['Actions','Service Provider','Service','Created Date','Status','',],  
        height: 250,
        colModel:[
            {name: 'myac', index: '', width: 80, fixed: true, sortable: false, resize: false,
                formatter: 'actions',
                formatoptions: {
                     keys: true,
                     delOptions: {recreateForm: true, beforeShowForm: beforeDeleteCallback},
                     editbutton:false,
                 }
            },
            {name:'USERNAME',index:'USERNAME', width:100,},
            {name:'S_BUSINESSNAME',index:'S_BUSINESSNAME', width:100,},
            {name:'A_CREATED_DATE',index:'A_CREATED_DATE', width:100,},
            {name:'A_STATUS',index:'A_STATUS', width:100,},
            {name:'A_ID',index:'A_ID',hidden:true,key:true},
        ],

using this code I get ope=del and id default but I want more extra parameters, who knows this help me out.


Solution

  • try this code

    {name: 'myac', index: '', width: 80, fixed: true, sortable: false, resize: false,
                    formatter: 'actions',
                    formatoptions: {
                         keys: true,
                         delOptions: {recreateForm: true, beforeShowForm: beforeDeleteCallback,url: 'abc.php?action=delete'},
    
                         editbutton:false,
                     }
                },