easyui中在formatter: function (value, row,index) {中添加删除方法
{
field : 'abj',
title : '操作',
align : 'center',
resizable:false,
width:'10%',
formatter: function (value, row,index) {
html = "<a href='javascript:;' onclick='deleteMessage("+row.message_number+","+row.approval_status+")'>删除</a>";
return html
}
}
js代码
//列表中的删除按钮
function deleteMessage(message_number,approval_status){
if(2==approval_status){
$.messager.show({
title:'提示',
msg: '审批通过的不允删除!',
showType:'show'
});
return;
}
$.post('<%=basePath%>xyData/platform/deletePlatformMessage.do?message_number=' + message_number,
function (result) {
$.messager.show({
title:'提示',
msg: result.msg,
showType:'show'
});
$('#platformMessageTable').datagrid('reload'); // reload the user data
},'json');
}
2.
formatter: function (value, row,index) {
var html;
if(value=='0'){
html = "<input type='button' class='button_in_table' onclick='changeTriggerFlag(\""+ row.sur_id +"\","+1+","+index+")' value='患者调查'>" +
"<input type='button' class='button_in_table' onclick='changeTriggerFlag(\""+row.sur_id+"\","+2+","+index+")' value='置为无效'>"
}
return html;
}