简体   繁体   English

如何使用Asp.Net Mvc HtmlHelper设置Kendo菜单的popupCollision配置属性?

[英]How to set popupCollision configuration property of Kendo Menu using Asp.Net Mvc HtmlHelper?

The example for Kendo Menu documentation here sets the popupCollision property in Javascript. Kendo Menu文档的示例在此处使用Javascript设置popupCollision属性。 How can this property be set using Asp.Net MVC HtmlHelpers for Kendo Menu? 如何使用Asp.Net MVC HtmlHelpers for Kendo菜单设置此属性?

According to Menu Builder ASP.NET MVC documentation there is not such property. 根据菜单生成器ASP.NET MVC文档 ,没有这样的属性。 Unfortunately this differeneces sometimes happens betveen JS and ASP versions like there are two other teams of developers. 不幸的是,这种区别有时会在JS和ASP版本之间发生,就像另外两个开发团队一样。

MVC HTML Helper just generate JavaScript code, so you can try set it using JavaScript setOptions on document ready: MVC HTML Helper只是生成JavaScript代码,因此您可以尝试在准备就绪的文档上使用JavaScript setOptions对其进行设置:

$("#menu").data('kendoMenu').setOptions({
    popupCollision: false
});

Or even better, use the javascript version in the first place if you need this property. 甚至更好,如果需要此属性,请首先使用javascript版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM