[英]facing datatable cell index error when calling datatable on a table
im facing datatable cell index error while calling datatable method on the below table im unable to find whats wrong with my code ,can anyone help me with this.我在调用下表上的数据表方法时遇到数据表单元格索引错误,我无法找到我的代码有什么问题,任何人都可以帮我解决这个问题。
<div class="table-responsive top-space reportActionTable mt-0" id="reportTable">
<table class="table" id="reportTable1">
<thead>
<tr>
<th>View Detail</th>
<th>Professional</th>
<th>Patient</th>
<th>Date & time</th>
<th>Checked In</th>
<th>Checked Out</th>
<th>Status</th>
<th>Slot Type</th>
</tr>
</thead>
<tbody>
@if (Model != null && Model.appointmentModels.Count > 0)
{
foreach (var item in Model.appointmentModels)
{
<tr>
@if (item.StatusText == EPS.BAL.Model.AppointmentStatus.Confirmed)
{
<td><i class="fa fa-plus-circle fa-2x tableToggleBtn"></i></td>
}
else if (item.StatusText == EPS.BAL.Model.AppointmentStatus.Unconfirmed)
{
<td><i class="fa fa-plus-circle fa-2x tableToggleBtn"></i></td>
}
else if (item.StatusText == EPS.BAL.Model.AppointmentStatus.PracticeRescheduled)
{
<td><i class="fa fa-plus-circle fa-2x tableToggleBtn"></i></td>
}
else if (item.StatusText == EPS.BAL.Model.AppointmentStatus.PracticeCancelled)
{
<td><i class="fa fa-plus-circle fa-2x tableToggleBtn"></i></td>
}
else if (item.StatusText == EPS.BAL.Model.AppointmentStatus.PatientNoshows)
{
<td><i class="fa fa-plus-circle fa-2x tableToggleBtn"></i></td>
}
else if (item.StatusText == EPS.BAL.Model.AppointmentStatus.PatientCancellations)
{
<td><i class="fa fa-plus-circle fa-2x tableToggleBtn"></i></td>
}
else if (item.StatusText == EPS.BAL.Model.AppointmentStatus.Unconfirmed)
{
<td><i class="fa fa-plus-circle fa-2x tableToggleBtn"></i></td>
}
else
{
<td><i class="fa fa-plus-circle fa-2x tableToggleBtn"></i></td>
}
<td>@item.DoctorName</td>
<td>
<b>
Name :
</b>
<span></span>@item.PatientName
@if (!string.IsNullOrEmpty(item.Mobile))
{
<b>Phone :</b> <a href="tel:@item.Mobile"><span></span>@item.Mobile</a>
}
</td>
@if (item.Date != null && item.Time != null)
{
<td>@string.Format("{0:MMMM dd yyyy}", item.Date) - @item.AppointmentTime</td>
}
else
{
<td> No Date time chosen</td>
}
<td>
@item.strCheckIn
@if (item.CkeckIn == true && item.CheckOut != true)
{
if (item.ReportStatusText == null)
{
@: <a href="@Url.Action("UndoCheckedin", "Diagnostic", new { key = @item.ID, ParentPatientID = @item.ParentPatientID })">Undo</a>
}
}
@if (item.CheckInTime != null && item.CkeckIn == true)
{
@:(@string.Format("{0:MMMM dd yyyy hh:mm tt}", item.CheckInTime))
}
</td>
<td>
@item.strCheckOut
@if (item.CheckOutTime != null)
{
@:(@string.Format("{0:MMMM dd yyyy hh:mm tt}", item.CheckOutTime))
}
</td>
@if (item.StatusText == EPS.BAL.Model.AppointmentStatus.Confirmed)
{
<td><div class="icon iconConfirmedAppointments"></div></td>
}
else if (item.StatusText == EPS.BAL.Model.AppointmentStatus.Unconfirmed)
{
<td><i class="fa fa-clock-o fa-2x"></i></td>
}
else if (item.StatusText == EPS.BAL.Model.AppointmentStatus.PracticeRescheduled)
{
<td><div class="icon iconPracticeRescheduled"></div></td>
}
else if (item.StatusText == EPS.BAL.Model.AppointmentStatus.PracticeCancelled)
{
<td><i class="fa fa-minus-circle text-danger fa-2x"></i></td>
}
else if (item.StatusText == EPS.BAL.Model.AppointmentStatus.PatientNoshows)
{
<td><div class="icon iconPatientNoShows"></div></td>
}
else if (item.StatusText == EPS.BAL.Model.AppointmentStatus.PatientCancellations)
{
<td><div class="icon iconPatientCancellations iconLeft"></div></td>
}
else if (item.StatusText == EPS.BAL.Model.AppointmentStatus.Unconfirmed)
{
<td><i class="fa fa-ban text-danger fa-2x"></i></td>
}
else
{
<td></td>
}
@if (item.WithoutSlot == true)
{
<td><div class="icon iconPatientWithoutSlot"></div></td>
}
else if (item.WithoutSlot == false)
{
<td><div class="icon iconPatientWithSlot"></div></td>
}
</tr>
<tr>
<td colspan="9" class="p-0">
@* code *@
<div class="tableToggleUl">
<div class="row d-flex m-0 customlist">
<div class="col-md-4 customlistCol">
<label>Visit Status</label>
@if (!string.IsNullOrEmpty(item.ReportStatusText))
{
<span>@item.ReportStatusText</span>
}
else
{
<span></span>
}
</div>
<div class="col-md-4 customlistCol">
<label>Record Uploaded</label>
@if (item.RerecordUploadedYN == true)
{
<span>Yes</span>
}
else
{
<span>No</span>
}
</div>
<div class="col-md-4 customlistCol">
<label>Order Received</label>
@if (item.OrderReceivedYN == true)
{
<span>Yes</span>
}
else
{
<span>No</span>
}
</div>
</div>
<div class="row d-flex m-0 customlist">
<div class="col-md-4 customlistCol">
<label>Authorization</label>
@if (item.AuthorizationYN == true)
{
<span>Yes</span>
}
else
{
<span>No</span>
}
</div>
<div class="col-md-4 customlistCol">
<label>Care Plan Uploaded</label>
@if (item.IsCarePlanuploaded == true)
{
<span>Yes</span>
}
else
{
<span>No</span>
}
</div>
<div class="col-md-4 customlistCol">
<label style="white-space:nowrap;">Guardian Name</label>
@if (item.ParentPatientID != null)
{
<span>@item.GuardianName </span>
}
else
{
<span></span>}
</div>
</div>
<div class="row d-flex m-0 customlist">
<div class="col-md-4 customlistCol">
<label>Referred By</label>
@if (item.ReferralProviderTypeID == Convert.ToInt32(Session["UserType"]) && item.ReferralProviderID == Convert.ToInt32(Session["DoctorID"]))
{
<span>Own Appointment</span>
}
else if (item.ReferralProviderTypeText != null)
{
<span>@item.ReferralProviderName (@item.ReferralProviderTypeText)</span>
}
else
{
<span>@item.ReferralProviderName</span>
}
</div>
<div class="col-md-4 customlistCol">
<label>Created By</label>
<span>@item.CreatedByInitials</span>
</div>
<div class="col-md-4 customlistCol">
<label>Insurance</label>
@if (item.InsuranceText != null)
{
<span>@item.InsuranceText</span>
}
else
{
<span></span>
}
</div>
</div>
<div class="row d-flex m-0 customlist">
<div class="col-md-6 customlistCol">
<label>Visit Reason</label>
@if (!string.IsNullOrEmpty(item.Reason))
{
if (!string.IsNullOrEmpty(item.ReasonOfVisitOthers))
{
<span>@item.Reason , @item.ReasonOfVisitOthers</span>
}
else
{
<span>@item.Reason</span>
}
}
else
{
<span>@item.ReasonOfVisitOthers</span>
}
</div>
<div class="col-md-6 customlistCol">
<label>How Did Hear</label>
<span>@item.AppointmentSourceText</span>
</div>
</div>
<div class="row d-flex m-0 customlist">
<div class="col-md-6 customlistCol">
<label>Location</label>
<span>@item.LocationText</span>
</div>
<div class="col-md-6 customlistCol">
<label>Special Instructions</label>
<span>@item.SpecialInstructions</span>
</div>
</div>
</div>
@* code end *@
</td>
</tr>
}
}
</tbody>
</table>
</div>
Please see the above code and tell me what's wrong with this as there are equal number of columns in this and a section also contain more data on clicking plus icon ,please need some help here.请查看上面的代码并告诉我这有什么问题,因为此中的列数相同,并且一个部分还包含有关单击加号图标的更多数据,请在此处需要一些帮助。
您应该使用正确的列数
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.