telerik-mvc - 用于 Asp.Net MVC 的 Telerik UI 无法在可排序中编辑输入项
问题描述
一旦我将可排序对象添加到容器中,就无法编辑任何输入元素:
<ul class="kt-portlet__body no-bullets" id="UnitEditor">
<li>
@using (Html.BeginCollectionItem("Units"))
{
<div data-id="@Model.UnitId" id="@Model.UnitId" class="row editorRow" style="padding-bottom: 10px;">
@Html.HiddenFor(x => x.UnitId)
@Html.HiddenFor(x => x.SortIndex, new { id = "SortIndex" })
<div class="col-md-3">
<label class="kt-popover kt-font-bold" data-toggle="kt-popover" data-placement="top" data-trigger="hover" data-html="true" data-content="The name of the Unit that will be displayed. (Max-Length:150)">Unit Name</label>
@Html.TextBoxFor(x => x.UnitName, new { @class = "form-control" })
</div>
@if (ViewBag.isSiteAdmin)
{
<div class="col-md-2">
<label class="kt-popover" data-toggle="kt-popover" data-placement="top" data-trigger="hover" data-html="true" data-content="Select the Competency Type which will determine the scope of usage.">Competency Type</label>
@Html.DropDownListFor(x => x.CompetencyTypeId, new SelectList(Model.competencyTypeSelect, "Id", "Text"), "Select Type", new { @class = "form-control", data_competencyType = Model.UnitId })
</div>
<div id="CompanySelectDiv_@Model.UnitId" class="col-md-2" style="@(Model.CompetencyTypeId == 2 ? "" : "display: none;")">
<label class="kt-popover" data-toggle="kt-popover" data-placement="top" data-trigger="hover" data-html="true" data-content="Select the Company specific to this Unit.">Company</label>
@Html.DropDownListFor(x => x.CompanyId, new SelectList(Model.companySelect, "Id", "Text"), "Select Company", new { @class = "form-control", data_company = Model.UnitId })
</div>
}
else
{
@Html.HiddenFor(x => x.CompetencyTypeId)
@Html.HiddenFor(x => x.CompanyId)
}
<div class="col-md-2">
<label class="kt-popover kt-font-bold" data-toggle="kt-popover" data-placement="top" data-trigger="hover" data-html="true" data-content="The minimum Score required to avoid additional training.">Gap Closure Threshold</label>
@Html.TextBoxFor(x => x.GapClosureThreshold, new { @class = "form-control", @type = "number", id = "GapClosureThreshold" })
</div>
<div class="col-md-2" style="text-align: center;">
<label class="kt-popover kt-font-bold" data-toggle="kt-popover" data-placement="top" data-trigger="hover" data-html="true" data-content="The number of Evidences for this Unit.">Evidence Count</label>
<br />
@Html.DisplayTextFor(x => x.NumEvidences)
</div>
<div class="col-xl-1" style="padding-top: 22px;">
@if (Model.UnitId < 0)
{
<a class="editRow" style="cursor: pointer; padding-top: 20px;"><i title="Edit Unit" class="lnir lnir-pencil-alt" style="font-size: medium;"></i></a>
<a onclick="$(this).parent().parent().remove();" style="cursor: pointer; padding-top: 20px;"><i title="Remove new Unit" class="lnir lnir-trash-can-alt-1" style="font-size: medium;"></i></a>
}
else
{
<a class="editRow" style="cursor: pointer; padding-top: 20px;"><i title="Edit Unit" class="lnir lnir-pencil-alt" style="font-size: medium;"></i></a>
<a class="deleteRow" style="cursor: pointer; padding-top: 20px;"><i title="Remove Unit from Assessment" class="lnir lnir-trash-can-alt-1" style="font-size: medium;"></i></a>
}
@if (Model.Evidences != null)
{
if (Model.Evidences.Count > 0)
{
for (int i = 0; i < Model.Evidences.Count; i++)
{
@Html.HiddenFor(m => m.Evidences[i].UnitId)
@Html.HiddenFor(m => m.Evidences[i].EvidenceId)
@Html.HiddenFor(m => m.Evidences[i].Description)
@Html.HiddenFor(m => m.Evidences[i].ResponseTypeId)
@Html.HiddenFor(m => m.Evidences[i].Active)
}
}
}
</div>
</div>
}
</li>
</ul>
@if (Model.AssessmentId != -1)
{
@(Html.Kendo().Sortable()
.For("#UnitEditor")
.PlaceholderHandler("placeholder")
.Events(events => events.Change("onSort"))
)
}
解决方案
推荐阅读
- css - 使用 react 和 material-ui,我可以让一些纸在容器外扩展到全宽吗?
- django - Django allauth - 电子邮件验证成功后添加自定义逻辑
- c# - HttpClient.GetAsync 在运行一段时间后失败,TaskCanceledException“任务已取消”
- javascript - JavaScript 中的变量范围,提升,执行上下文
- python - 此代码仅适用于 4 或 5 次迭代,这怎么可能?
- python - 如何让数据生成器更高效?
- actionscript-3 - 动画中的错误(1023:不兼容的覆盖。和 1021:重复的函数定义。)
- c++ - unity C unittest 框架可以用来对 C++ 代码进行单元测试吗?
- flutter - flutter 有 redux 依赖的问题
- javascript - 为什么我的页面没有从 API 调用返回数据,尽管它是异步的并且尽管页面仅在函数返回后才呈现?