//删除附件function Ajax_DelAttachmentFile(attFileId) { ////// 删除附件 /// /// 文件ID ///var drawingState = $("#DrawingState").val(); var drawingId = $("#DrawingId").val(), drawingListObj = $("#DrawingFileIdList"), drawingList = drawingListObj.val() + ","; $.getJSON("/Elevator/DelAttachmentFile", { drawingId: drawingId, drawingFileId: attFileId }, function (json) { //by litao 2012-06-08 var objParentID = $(P_PopThis).parents("table")[0].id; //当前对象上级为“table”的对象ID值 //根据objParentID推测出另一个对象ID值 var brotherParentID = (/^.*s$/.test(objParentID)) ? objParentID.substr(0, objParentID.length - 1) : objParentID + "s"; $("#" + brotherParentID).find("input[type='hidden']").each(function (n, obj) { if ($(obj).attr("value") == attFileId) { $(obj).parents("tr").remove(); } }); $(P_PopThis).parents("tr").remove(); P_PopCls.isSuccess(1, '成功删除附件!'); drawingList = drawingList.replace(attFileId + ",", ""); drawingList != "" ? drawingList = drawingList.substring(0, drawingList.length - 1) : 0; drawingListObj.val(drawingList); }); }