I figured out for a link but how to manage it for a delete option
<th field ="detail" width = "120" formatter="formatDetail">Actions</th>
function formatDetail(value,row){
var href = 'innerlist.php?list='+row.id;
var dhref = 'dellist.php?list='+row.id;
return '<center><a target="_blank" href="' + href + '"><span class="btn btn-primary btn-xs"><i class="fa fa-search"></i> Preview</span></a><a href="' + dhref + '" class="easyui-linkbutton" iconCls="icon-remove" plain="true" >Remove Entry</a></center>';
}
using this
function destroyUser(row){
if (row){
$.messager.confirm('Confirm','Are you sure you want to destroy this user?',function(r){
if (r){
$.post('destroy_user.php',{id:row.id},function(result){
if (result.success){
$('#dg').datagrid('reload'); // reload the user data
} else {
$.messager.show({ // show error message
title: 'Error',
msg: result.errorMsg
});
}
},'json');
}
});
}
}
I tried to add onclick destroy(row.id) but seems not working somehow. 20 message boxes appears on load.