Flexigrid加载正常但.flexigrid()无法访问

时间:2013-08-26 21:41:07

标签: javascript jquery jquery-ui jquery-plugins flexigrid

我视图中的代码非常简单,但我不断收到此错误消息

  

未捕获的TypeError:对象[object Object]没有方法'flexigrid'

谁能看到我做错了什么? js文件加载正常。我发布了一个alert语句,每次加载页面时都会触发。

<link href="@Url.Content("~/Content/flexigrid.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.8.2.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/flexigrid.js")" type="text/javascript"></script>
<script>
    $(document).ready(function () {
        $(".flex1").flexigrid(
            {
                url: '@Url.Action("TestData","Home")',
                dataType: 'json',
                colModel : [
                {display: 'ID', name : 'id', width : 40, sortable : true, align: 'left'},
                {display: 'First Name', name : 'first_name', width : 150, sortable : true, align: 'left'},
                {display: 'Surname', name : 'surname', width : 150, sortable : true, align: 'left'},
                {display: 'Position', name : 'email', width : 250, sortable : true, align: 'left'}
                ],
                buttons : [
                {name: 'Edit', bclass: 'edit'},
                {name: 'Delete', bclass: 'delete'},
                {separator: true}
                ],
                searchitems : [
                {display: 'First Name', name : 'first_name'},
                {display: 'Surname', name : 'surname', isdefault: true},
                {display: 'Position', name : 'position'}
                ],
                sortname: "id",
                sortorder: "asc",
                usepager: true,
                title: "Staff",
                useRp: true,
                rp: 10,
                showTableToggleBtn: false,
                resizable: false,
                width: 700,
                height: 370,
                singleSelect: true
            });
    });
</script>

0 个答案:

没有答案