I have some problem for deleting a row in jqGrid.
My row consists of two primary keys which are email and idms_module. These two keys are needed for deleting the row, because one email can have two or more idms_module.
Here's the syntax:
jQuery("#grid-uac").jqGrid({
mtype:'GET',
url:'functions/get_useraccess.php',
editurl:'functions/edit_useraccess.php',
datatype: "JSON",
colNames:['User Email','Module Access','Level Access'],
colModel:[
{name:'user_email', width:300, editable:true, key:true},
{name:'module_access', width:550,editable:true, key:true,edittype:'select',editoptions:{dataUrl:'functions/get_modusracc.php'}},
{name:'level_access',width:100,editable:true,edittype:'select',editoptions:{value:"0:read only;1:read write"}}
],
loadComplete: function () {
alert("OK");
},
loadError: function (jqXHR, textStatus, errorThrown) {
alert('HTTP status code: ' + jqXHR.status + '\n' +
'textStatus: ' + textStatus + '\n' +
'errorThrown: ' + errorThrown);
alert('HTTP message body (jqXHR.responseText): ' + '\n' + jqXHR.responseText);
},
rowNum:10,
rowList:[5,10,15],
pager: '#pager-uac',
sortname: 'user_email',
viewrecords: true,
jsonReader: **{id: "user_email", id2 or some var : "module_access"}**,
sortorder: "asc",
gridview: true,
autoencode:true,
caption:"Inventory User Access Role"
});
So for example I want to delete a row, which consists of email: admin@test.com and idms_module: 6
The part of the php code is:
$email = $_REQUEST['id'];
$modules= $_REQUEST['another var'];
$query = DELETE FROM table WHERE email= $email AND module = $modules
I have successfully gotten the email from the id but haven't got any ideas on how to get the 'another var'