在做删除时,由于id号是uuid,因此无法像数字那样传递,需要转义
[ {field:'ck',checkbox:true}, {title:'ID',field:'id',width:350,hidden:true,sortable:true}, {title:'新闻标题',field:'title',width:350,sortable:true,formatter:function(value,row,index){ return '<a href="newsView.shtml?id='+row.id+'" target="_blank"><font color="#076AC8">'+value+'</font></a>'; }, styler: function(value,row,index){ return 'color:red;'; }}, {title:'作者',field:'author',width:180,sortable:true}, {title:'分类',field:'newsType',width:180,sortable:true}, {title:'日期',field:'createTime',width:180,sortable:true,align:'center'}, {title:'置顶',field:'toTop',width:40,sortable:false,align:'center',formatter:function(value,row,index){ return '<img src="images/easyui/totop.png" onclick="javascript:alert("ok")"/>'; }}, {title:'修改',field:'edit',width:40,sortable:false,align:'center',formatter:function(value,row,index){ return '<a href="editNews.shtml?json=1&id='+row.id+'" target="_blank"><img src="images/easyui/pencil.png"/></a>'; }}, {title:'删除',field:'delete',width:40,sortable:false,align:'center', formatter:function(value,row,index){ return '<img src="images/easyui/edit_remove.png" onclick="deleteNewsById('+"\'"+row.id+"\'"+');"/>'; } }, ]
formatter:function(value,row,index){
return '<img src="images/easyui/edit_remove.png" onclick="deleteNewsById('+"\'"+row.id+"\'"+');"/>';
}