employee children delet bug fixed
This commit is contained in:
@@ -208,27 +208,45 @@
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<input asp-for="EditEmployeChildrenList[index].DateOfBirth" class="items childInput persianDateInput ltr text-center childBirth col-md-12 col-lg-12 col-sm-12 col-xs-12" type="text" placeholder="" maxlength="10">
|
||||
</div>
|
||||
<div>
|
||||
@if (index == 0)
|
||||
{
|
||||
<a>
|
||||
<i class="fa fa-trash trash" aria-hidden="true" style="color: #818181;">
|
||||
</i>
|
||||
@* <input type="checkbox" style="display:none" asp-for="EditEmployeChildrenList[0].IsRemoved"/> *@
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a id="delete_@index" class="delete">
|
||||
<i class="fa fa-trash trash trash-icon" aria-hidden="true">
|
||||
</i>
|
||||
@*<input type="checkbox" style="display:none" asp-for="EditEmployeChildrenList[index].IsRemoved"/> *@
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
<input type="checkbox" style="display:none" asp-for="EditEmployeChildrenList[index].IsRemoved"/>
|
||||
<input type="hidden" asp-for="EditEmployeChildrenList[index].Id"/>
|
||||
</td>
|
||||
<div>
|
||||
@if (index == 0)
|
||||
{
|
||||
<a>
|
||||
<i class="fa fa-trash trash" aria-hidden="true" style="color: #818181;">
|
||||
</i>
|
||||
@* <input type="checkbox" style="display:none" asp-for="EditEmployeChildrenList[0].IsRemoved"/> *@
|
||||
</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a id="delete_@index" class="delete" >
|
||||
<i class="fa fa-trash trash trash-icon" aria-hidden="true">
|
||||
</i>
|
||||
@*<input type="checkbox" style="display:none" asp-for="EditEmployeChildrenList[index].IsRemoved"/> *@
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
<script>
|
||||
$(document).on("click", ".delete", function () {
|
||||
// پیدا کردن نزدیکترین tr به آیکون حذف کلیک شده
|
||||
var row = $(this).closest("tr");
|
||||
|
||||
// پیدا کردن input checkbox داخل این سطر
|
||||
var checkbox = row.find("input[type='checkbox']");
|
||||
|
||||
// تنظیم مقدار آن به true (یعنی checked)
|
||||
checkbox.prop("checked", true);
|
||||
|
||||
// اختیاری: حذف ظاهری سطر از جدول
|
||||
row.hide();
|
||||
});
|
||||
</script>
|
||||
|
||||
<input type="checkbox" del-data="EditEmployeChildrenList[index].Id" style="display:none" asp-for="EditEmployeChildrenList[index].IsRemoved" />
|
||||
<input type="hidden" asp-for="EditEmployeChildrenList[index].Id"/>
|
||||
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<input asp-for="EditEmployeChildrenList[index].FName" class=" items1 childInput childName col-md-12 col-lg-12 col-sm-12 col-xs-12" type="text" placeholder="" pattern="[\u0600-\u06FF\s]*">
|
||||
@@ -430,6 +448,11 @@
|
||||
<script src="~/lib/select2/js/i18n/fa.js"></script>
|
||||
<script>
|
||||
|
||||
function delChildren(deleteChildrenId){
|
||||
alert(deleteChildrenId);
|
||||
var sel = $(`input[del-data=${deleteChildrenId}]`).val();
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#divEdit #close").click(function() {
|
||||
|
||||
Reference in New Issue
Block a user