所以,我已经在堆栈上研究了这个相当的升技但是没有找到与我的具体问题相关的任何内容。
我正在通过JQuery Get加载mvc 3局部视图。部分中的JQuery UI元素(自动完成组合框和按钮)不显示为JQuery UI元素。
在我的JQuery Get中,我正在进行以下调用:
$(".btnAdd").live('click', function () {
$.get(urlAdd, { dayid: btnid, rowcount: rowcount, datatype: 'html' }, function (data) {
$(".btnButton").button();
$(".combobox").combobox();
});
});
部分视图:
@model SomeModel.Web.ViewModel.SomeModelView
</td>
<td align="center">
<div class="editor-field">
<select id="projects-@ViewBag.RowCount" class="combobox">
</select>
</div>
</td>
<td>
<div class="editor-field">
@Html.EditorFor(model => model.HoursWorked, Model.HoursWorked)
@Html.ValidationMessageFor(model => model.HoursWorked)
</div>
</td>
<td align="center">
<div class="editor-field">
@Html.CheckBoxFor(model => model.isBillable)
@Html.ValidationMessageFor(model => model.isBillable)
</div>
</td>
<td>
<input type="button" class="btnButton" data-id="@ViewBag.ModelIndex" value="Delete" />
</td>
</td>
<td align="center">
<div class="editor-field">
<select id="projects-@ViewBag.RowCount" class="combobox">
</select>
</div>
</td>
<td>
<div class="editor-field">
@Html.EditorFor(model => model.HoursWorked, Model.HoursWorked)
@Html.ValidationMessageFor(model => model.HoursWorked)
</div>
</td>
<td align="center">
<div class="editor-field">
@Html.CheckBoxFor(model => model.isBillable)
@Html.ValidationMessageFor(model => model.isBillable)
</div>
</td>
<td>
<input type="button" class="btnButton" data-id="@ViewBag.ModelIndex" value="Delete" />
</td>
我尝试重新初始化get函数中的选择器,但这不起作用。
非常感谢任何帮助和见解!