kendo 未定义工具提示事件
kendo toolTip event is not defined
我正在尝试添加一个工具提示以获取一些信息,但是,我在使用它时遇到了一些问题。当我尝试添加 RequestStart 事件或任何事件时,我收到一个显示
的错误
"Uncaught ReferenceError: ShipScheduleDsTooltip_RequestStart is not defined"
我不知道为什么不允许此代码。我在几个不同的地方有几乎完全相同的代码。这是出现错误的代码。
@(Html.Kendo().Tooltip()
.For("#ShipSchedule-wrapper")
.Filter(".ShipSchedule-jobs-wrapper")
.LoadContentFrom("DesignSetTooltip", "ProductionOverview")
//.Content("toolTipTestContent")
.Position(TooltipPosition.Left)
.AutoHide(false)
.Width(600)
//.Height(300)
.ShowOn(TooltipShowOnEvent.Click)
.Events(events => events.RequestStart("ShipScheduleDsTooltip_RequestStart"))
//.Events(events => events.Show("onTap"))
)
这是ShipScheduleDsTooltip_RequestStart
function ShipScheduleDsTooltip_RequestStart(e) {
e.options.data = {
designSetId: e.target.data("designSetId")
}
}
所以,如果有人有任何想法,我将不胜感激。
编辑
可能是我在函数中添加的 id 上设置了工具提示 .For 和 .Filter 吗?
您的小部件在函数之前呈现。参见 Kendo Fundamentals on Deferred。
更改您的小部件:
@(Html.Kendo().Tooltip()
.For("#ShipSchedule-wrapper")
.Filter(".ShipSchedule-jobs-wrapper")
.LoadContentFrom("DesignSetTooltip", "ProductionOverview")
.Position(TooltipPosition.Left)
.AutoHide(false)
.Width(600)
.ShowOn(TooltipShowOnEvent.Click)
.Events(events => events.RequestStart("ShipScheduleDsTooltip_RequestStart"))
.Deferred() // Defer script gen to below
)
然后在底部的脚本标签中:
<script type="text/javascript">
function ShipScheduleDsTooltip_RequestStart(e) {
e.options.data = {
designSetId: e.target.data("designSetId")
}
}
@Html.Kendo().DeferredScripts(false) // Render the widget js here after the function
</script>
我正在尝试添加一个工具提示以获取一些信息,但是,我在使用它时遇到了一些问题。当我尝试添加 RequestStart 事件或任何事件时,我收到一个显示
的错误"Uncaught ReferenceError: ShipScheduleDsTooltip_RequestStart is not defined"
我不知道为什么不允许此代码。我在几个不同的地方有几乎完全相同的代码。这是出现错误的代码。
@(Html.Kendo().Tooltip()
.For("#ShipSchedule-wrapper")
.Filter(".ShipSchedule-jobs-wrapper")
.LoadContentFrom("DesignSetTooltip", "ProductionOverview")
//.Content("toolTipTestContent")
.Position(TooltipPosition.Left)
.AutoHide(false)
.Width(600)
//.Height(300)
.ShowOn(TooltipShowOnEvent.Click)
.Events(events => events.RequestStart("ShipScheduleDsTooltip_RequestStart"))
//.Events(events => events.Show("onTap"))
)
这是ShipScheduleDsTooltip_RequestStart
function ShipScheduleDsTooltip_RequestStart(e) {
e.options.data = {
designSetId: e.target.data("designSetId")
}
}
所以,如果有人有任何想法,我将不胜感激。
编辑 可能是我在函数中添加的 id 上设置了工具提示 .For 和 .Filter 吗?
您的小部件在函数之前呈现。参见 Kendo Fundamentals on Deferred。
更改您的小部件:
@(Html.Kendo().Tooltip()
.For("#ShipSchedule-wrapper")
.Filter(".ShipSchedule-jobs-wrapper")
.LoadContentFrom("DesignSetTooltip", "ProductionOverview")
.Position(TooltipPosition.Left)
.AutoHide(false)
.Width(600)
.ShowOn(TooltipShowOnEvent.Click)
.Events(events => events.RequestStart("ShipScheduleDsTooltip_RequestStart"))
.Deferred() // Defer script gen to below
)
然后在底部的脚本标签中:
<script type="text/javascript">
function ShipScheduleDsTooltip_RequestStart(e) {
e.options.data = {
designSetId: e.target.data("designSetId")
}
}
@Html.Kendo().DeferredScripts(false) // Render the widget js here after the function
</script>