我收到用于 Telerik 网格实现的 javascript 错误“JQuery undefined”,我不明白同样的原因。我确实包含了所有可能的 JQuery 文件,但仍然出现 Javascript 错误。
下面是我实现的示例代码。
<script src="@Url.Content("~/Scripts/jquery-1.7.1.js")" type="text/javascript"></script>
@(Html.Telerik().Grid(Model.Employee)
.HtmlAttributes(new { style = "width:100%;" })
.Name("Employee")
.DataKeys(keys =>
{
keys.Add(m => Id);
})
.Columns(columns =>
{
columns.Bound(p => p.Name).Title("Name")
.HeaderHtmlAttributes(new { width = "110px", style = "text-align:center;font-weight:bold;height:auto" })
.HtmlAttributes(new { width = "110px", style = "text-align:left;height:auto" });
columns.Bound(p => p.ReportedStatus).ClientTemplate("<#= ReportedStatus(data) #>").Title("Reported")
.HeaderHtmlAttributes(new { width = "130px", style = "text-align:center;font-weight:bold;height:auto" })
.HtmlAttributes(new { width = "130px", style = "text-align:center;height:auto" });
columns.Bound(p => p.status).Title("status").ClientTemplate("<#=status(data) #>")
.HeaderHtmlAttributes(new { width = "130px", style = "text-align:center;font-weight:bold;height:auto" })
.HtmlAttributes(new { width = "130px", style = "text-align:center;height:auto" });
columns.Bound(p => p.Hrs).Title("Hrs")
.HeaderHtmlAttributes(new { width = "150px", style = "text-align:center;font-weight:bold;height:auto" })
.HtmlAttributes(new { width = "150px", style = "text-align:center;height:auto" });
columns.Bound(l => l.Location).ClientTemplate("<#= Location(data) #>").Title("Location")
.HeaderHtmlAttributes(new { width = "200px", style = "text-align:center;font-weight:bold;height:auto" })
.HtmlAttributes(new { width = "200px", style = "text-align:center;height:auto" });
columns.Bound(l => l.Role).ClientTemplate("<#= Role(data) #>").Title("Role")
.HeaderHtmlAttributes(new { width = "150px", style = "text-align:center;font-weight:bold;height:auto" })
.HtmlAttributes(new { width = "150px", style = "text-align:center;height:auto" });
}).Footer(false)
)
<script type="text/javascript" src="@Url.Content("~/Scripts/telerik.common.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/telerik.textbox.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/telerik.grid.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/telerik.draganddrop.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/telerik.window.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/telerik.grid.editing.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/telerik.upload.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/telerik.menu.js")"></script>
@(Html.Telerik().ScriptRegistrar()
.jQuery(false)
.DefaultGroup(group => group
.Add("telerik.examples.min.js")
.Add("telerik.grid.js")
.Compress(false)
.Combined(true))
.OnDocumentReady(
@<text> prettyPrint();
</text>)
)
请让我知道我在这里为这个 JQuery 错误做错了什么。
提前致谢, Maanoj