asp.net-mvc – 使用KendoUI Grid的KendoUI编辑器模板问题
发布时间:2020-12-16 09:39:26 所属栏目:asp.Net 来源:网络整理
导读:我有一个KendoUI网格,它输出一些外键下拉菜单和其他字段,如日期,由于某种原因,在呈现控件之前和之后添加了一些随机文本/字符.在下面的这个块中, $Bw $ $Bx的$在呈现选择列表之前输出到浏览器作为文本,然后是 $By $. td role="gridcell" data-container-for="
我有一个KendoUI网格,它输出一些外键下拉菜单和其他字段,如日期,由于某种原因,在呈现控件之前和之后添加了一些随机文本/字符.在下面的这个块中,< $Bw $> < $Bx的$>在呈现选择列表之前输出到浏览器作为文本,然后是< $By $>.
<td role="gridcell" data-container-for="StateProvinceId"><$Bw$> <!--$Bw$--><$Bx$><span style="" class="k-widget k-dropdown k-header" unselectable="on" role="listbox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-owns="StateProvinceId_listbox" aria-disabled="false" aria-readonly="false" aria-busy="false"><span unselectable="on" class="k-dropdown-wrap k-state-default"><span unselectable="on" class="k-input"> </span><span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s">select</span></span></span><input data-val="true" data-val-number="The field StateProvinceId must be a number." data-val-required="The StateProvinceId field is required." id="StateProvinceId" name="StateProvinceId" type="text" value="0" data-role="dropdownlist" style="display: none;" data-bind="value:StateProvinceId" class="valid"></span><script> jQuery(function(){jQuery("#StateProvinceId").kendoDropDownList({"dataSource":[],"dataTextField":"Text","dataValueField":"Value"});}); </script><!--$Bx$--><$By$> <!--$By$--><span class="field-validation-valid" data-valmsg-for="StateProvinceId" data-valmsg-replace="true"></span></td> FK编辑器模板只是默认模板. @using Kendo.Mvc.UI @model object @( Html.Kendo().DropDownListFor(m => m) .BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"]) ) 所有正在呈现的具有KendoUI编辑器模板的字段都会发生这种情况. 网格代码 @using Kendo.Mvc.UI @model Data.DataModels.Person @(Html.Kendo().Grid<Data.ViewModels.LicenseVM>() .Name("LicensesGrid") .Columns(columns => { columns.ForeignKey(p => p.StateProvinceId,(System.Collections.IEnumerable)ViewData["StateProvinces"],"StateProvinceId","Name") .Title("State"); columns.ForeignKey(p => p.LicenseTypeId,(System.Collections.IEnumerable)ViewData["LicenseTypes"],"LicenseTypeId","Name") .Title("Type"); columns.Bound(p => p.LicenseNumber).Width(150); columns.Bound(p => p.ExpirationDate).Width(150); columns.Command(commands => { commands.Edit(); // The "edit" command will edit and update data items commands.Destroy(); // The "destroy" command removes data items }).Title("").Width(200); }) .ToolBar(toolBar => { toolBar.Create().Text("Add License"); }) .DataSource(dataSource => dataSource .Ajax() .Events(events => events.Error("error_handler")) .Model(model => { model.Id(p => p.PersonLicenseId); model.Field(p => p.PersonId).Editable(false).DefaultValue(@Model.PersonId); }) .Read(read => read.Action("_GetLicenses","Person",new { PersonId = Model.PersonId })) .Create(create => create.Action("_AddLicense","Person")) .Update(update => update.Action("_EditLicense","Person")) .Destroy(destroy => destroy.Action("_DeleteLicense","Person")) ) ) <script type="text/javascript"> function errorHandler(e) { if (e.errors) { var message = "Errors:n"; $.each(e.errors,function (key,value) { if ('errors' in value) { $.each(value.errors,function () { message += this + "n"; }); } }); alert(message); } } </script> 解决方法
这可能是BrowserLink添加的标记.我建议您为此方案禁用它.
http://www.poconosystems.com/software-development/how-to-disable-browser-link-in-visual-studio-2013/ (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
推荐文章
站长推荐
- asp.net-mvc – 当我使用Validator.TryValidateO
- asp.net-core – 如何将ASP.NET 5从Beta6升级到B
- asp.net-core – CSS,图片,JS没有加载asp.net核心
- asp.net – 与Silverlight 5的串行通信(COM端口)
- ASP.Net Core Web Api中的异步视频流不起作用
- ASP.NET和Web Tools 2012.2引用LESS文件
- asp.net-mvc-3 – MVC 3(Razor) – 使用Button事
- asp.net – 无法在ASP应用程序中调试某些aspx页面
- ASP.NET MVC,AngularJS,Bower和部署站点文件夹结
- ASP.NET – 重定向301
热点阅读