JS传字符串类型主键

EasyUI部分

{
	              title:"操作",
	              field:"operation",
	              width:100,
	              align:"center",                                 
	              formatter:function(val,row){
	                  // language=HTML
                      return '<a class="remove" onclick="removePic(\''+row.pictureId+'\')" href="javascript:void(0)"></a>';
	              }

JQuery部分

function removePic(picId){
    //alert(picId);
    $.ajax({
        url:"/cmfz/picture/removePicture.do",
        type:"POST",
        dataType:"text",
        data:"pictureId="+picId,
        success:function(data){
            if('ok'==data){
                $.messager.show({
                    title:"提示",
                    msg:"删除成功",
                });
            }
            else{
                $.messager.show({
                    title:"提示",
                    msg:"删除失败",
                });
            }
            $("#piclist").datagrid("load");
        }
    });
}

猜你喜欢

转载自blog.csdn.net/weixin_42273990/article/details/81165586