阅读:2731
回复:3
|
子表中的重复项提示或者删除 |
1楼#
发布于:2018-09-19 10:06
在需要判断字段加OnChange事件
$("table[data-datafield='xxcgdlc_mx']").find("tr.rows").each(function () { var row = $(this).attr("data-row"); var objectid=$.MvcSheetUI.GetControlValue("xxcgdlc_mx.mxid", row); var result = CheckRepeat(objectid, row); } function CheckRepeat(from, row2) { var result = false; var fromCode = $.MvcSheetUI.GetControlValue("xxcgdlc_mx.mxid", row2); $("table[data-datafield='xxcgdlc_mx']").find("tr[data-row]").each(function () { var e = $(this).attr("data-row"); if (e != row2) { var toCode = $.MvcSheetUI.GetControlValue("xxcgdlc_mx.mxid", e); if (fromCode == toCode && fromCode != "" && fromCode != null) { result = true; } } }); return result; } |
|
2楼#
发布于:2018-09-19 10:07
if (result) {
$.MvcSheetUI.GetElement("xxcgdlc_mx").SheetGridView()._Deleterow($.MvcSheetUI.GetElement("xxcgdlc_mx.mxid", parseInt(row)).closest("tr")) } 这个是删除子表信息 |
|
3楼#
发布于:2018-09-19 11:02
实名用户_693da853:if (result) {可以使用,非常感谢! |
|