Front desk JS Code
function destroyexcelout () {
Returns multiple rows selected
var row = $ (' #dg '). DataGrid (' Getselections ');
Deciding whether to select BOC
if (row.length==0) {
$.messager.alert ("Hint", "Please select the row to delete!") "," info ");
return;
}Else{
var temid= "";
Bulk get evaluation template ID for selected row
$.messager.confirm (' Hint ', ' Do you want to delete the selected data? ', function (r) {
if (!R) {
return;
}
Link the ID string together
for (i = 0; i < row.length;i++) {
if (Temid = = "") {
Temid = row[i].id;
} Else {
Temid = Row[i].id + "," + temid;
}
}
$.post (' __root__/index.php/comprehensive/deletecomprehensive/', ' id= ' +temid,function(result) {
off (!result==false) {
$.messager.show ({//Show error message
Title: ' Success ',
Msg: ' Delete entry succeeded! ‘
});
$ (' #dg '). DataGrid (' reload '); Reload the user data
$ (' #dg '). DataGrid (' Clearselections ');
} Else {
$.messager.show ({//Show error message
Title: ' Failure ',
Msg: ' Operation failed!! ‘
});
}
}, ' json ');
});
}
$ (' #fm '). Form (' Load ', row);
}
Background code
Public function deletecomprehensive () {
$SJCJ =m (' SJCJ ');
$strTemId =i (' post.id ');
$strid =explode (', ', $strTemId);
$value = "";
foreach ($strid as $val) {
$value. = ", '". $val. "";
}
$result = $SJCJ->where ("ID in (". substr ($value, 1). ") ->delete ();
$result = $SJCJ->where (' id= '. I (' post.id '))->delete ();
if ($result = =true) {
Write log
$log =m (' log ');
$logData [' Operate ']= ' delete ';
$logData [' object ']= ' T_SJCJ ';
$logData [' Items ']=i (' post.tybh ');
$logData [' Time ']=date (' y-m-d h:i:s ');
$logData [' User ']=session (' user ');
$log->add ($logData);
}
echo $result;
}
}
Easyui check box Bulk operations