function deleteRecipeDetail(id,recipeid)
{
if(confirm("确定要删除记录吗?"))
{
$.ajax({
"url": "disease.deleteRecipeDetail.action",
"data":
{
"recipedetail.id":id,
"recipedetail.recipeid":recipeid
},
"dataType": "json",
"type": "POST",
"success": function( obj )
{//重新把处方明细列出来
if(obj!=null)
{
$("#recipedetaillines").empty();
$.each(obj.statisticsList, function(index, s){
var trObj = $("<tr></tr>");
trObj.attr("align","center");
$("<td></td>").html(index).appendTo(trObj);
$("<td></td>").html("name").appendTo(trObj);
$("<td></td>").html(s.dosage).appendTo(trObj);
$("<td></td>").html(s.unit).appendTo(trObj);
$("<td></td>").html(s.frequency).appendTo(trObj);
$("<td></td>").html(s.days).appendTo(trObj);
$("<td></td>").html(s.tips).appendTo(trObj);
$("<td></td>").html("<a href=\"#\" οnclick=\"modifyRecipeDetail()\"> 修改 </a> <a href=\"#\" οnclick=\"deleteRecipeDetail('','')\">删除 </a>").appendTo(trObj);
trObj.appendTo($("#recipedetaillines"));
});
}
}
});
}
}
上面js实现删除一条记录。
JQuery ajax调用示例
最新推荐文章于 2024-09-03 19:00:00 发布