51代码网ORACLEMYSQLSQL SERVER其它数据库java/jspasp/asp.netC/C++/VC++APP应用其它语言服务器应用
您现在的位置: 51代码网 >> asp.net >> 文章正文

Object [object Object] has no method 'jqGrid'

更新时间:2015-7-3:  来源:51代码网

代码:
@{
    ViewBag.Title = "Index";
}
@section Scripts {
    @Scripts.Render("~/bundles/index")
}
<link href="~/Jqgrid/css/cupertino/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" />
<link href="~/Jqgrid/css/cupertino/ui.jqgrid.css" rel="stylesheet" />

<script src="~/Scripts/jquery-1.8.2.js"></script>
<script src="~/Jqgrid/js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="~/Jqgrid/js/i18n/grid.locale-cn.js"></script>
<script src="~/Jqgrid/js/jquery.jqGrid.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#table_content").jqGrid({
            url: "~/Files/list.txt",
            datatype: "json",
            mtype: "get",
            height: 420,
            autowidth: true,
            colNames: ['编号', '城市', '国家', '手机号码'],
            colModel: [
                { name: 'CustomerID', index: 'CustomerID', width: '20%', align: 'center' },
                { name: 'City', index: 'City', width: '20%', align: 'center', sortable: false },
                { name: 'Country', index: 'Country', width: '20%', align: 'center', sortable: false },
                { name: 'Phone', index: 'Phone', width: '20%', align: 'center', sortable: false }
            ],
            rownumbers: true,
            viewrecords: true,
            rowNum: 15,
            rowList: [15, 20, 25],
            jsonReader: {
                root:"people",
                repeatitems: false
            },
            pager: '#gridPager'
        });
    });
</script>
<style type="text/css">
    #table_content tr{
        border:1px solid black;
    }
    #first_id{
        background-color:pink;
    }
</style>
<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
    <p>
        片名:<input id="input_searching" type="text" /><br />
        <input type="submit" value="查询" onclick="search()" />
        @Html.ActionLink("查看所有", "Index")
    </p>
   
    <p>@ViewBag.Message</p>
<table id="table_content">
</table>
<div id="gridPager"></div>

调换一下js的引入顺序就好了

  • 上一篇文章:
  • 下一篇文章: 没有了
  • 赞助商链接
    推荐文章
  • 此栏目下没有推荐文章
  • {
    设为首页 | 加入收藏 | 友情链接 | 网站地图 | 联系站长 |