MVC4 jqGrid寻呼机没有显示图标

时间:2013-12-19 11:45:56

标签: c# jquery asp.net-mvc asp.net-mvc-4 jqgrid

我在我的MVC4应用程序中使用jQGrid。一切正常,除了图标没有在寻呼机上显示。我需要帮助才能知道出了什么问题。

这是我的代码:

<link href="@Url.Content("~/Content/themes/jquery-ui.css")" rel="stylesheet" media="screen">
<link href="@Url.Content("~/Content/jquery.jqGrid/ui.jqgrid.css")" rel="stylesheet" media="screen">
<link href="@Url.Content("~/Content/jquery.jqGrid/ui.multiselect.css")" rel="stylesheet" media="screen">

<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>

<script src="@Url.Content("~/Scripts/i18n/grid.locale-pt.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.jqGrid.min.js")"></script>
<script src="@Url.Content("~/Scripts/ui.multiselect.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.tablednd.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.contextmenu.js")"></script>

<script type="text/javascript">

    jQuery(document).ready(function () {
        $('#myGrid').jqGrid({
            height: 300,
            toolbar: [true, 'bottom'],
            multiselect: true,
            cellEdit: false,
            rowNumbers: true,
            datatype: 'json',
            rowNum: 50,
            rowList: [50, 100, 200],
            url: '@Url.Action("GetGridData", "AdminSysLog")',
            editurl: '@Url.Action("CRUDGridData", "AdminSysLog")',
            contentType: "application/json; charset-utf-8",
            caption: 'System Logs',
            mtype: 'POST',
            shrinkToFit: false,
            pager: '#myPager',
            sortname: 'DateTime',
            sortorder: 'desc',
            viewrecords: true,
            colNames: ['DATETIME', 'LEVEL', 'TYPE', 'SYSTEM', 'USER', 'MESSAGE'],
            colModel: [
                            { name: 'DateTime', align: 'center', width: 140, sortable: true, editable: false, searchoptions: { sopt: ['eq', 'ne', 'cn'] } },
                            { name: 'Severity', align: 'center', width: 50, sortable: true, editable: false, searchoptions: { sopt: ['eq', 'ne', 'cn'] } },
                            { name: 'Type', align: 'center', width: 50, sortable: true, editable: false, searchoptions: { sopt: ['eq', 'ne', 'cn'] } },
                            { name: 'Source', align: 'center', width: 100, sortable: true, editable: false, searchoptions: { sopt: ['eq', 'ne', 'cn'] } },
                            { name: 'User', align: 'center', width: 100, sortable: true, editable: false, searchoptions: { sopt: ['eq', 'ne', 'cn'] } },
                            { name: 'Message', align: 'left', width: 500, sortable: true, editable: false, searchoptions: { sopt: ['eq', 'ne', 'cn'] } },
            ]
        }).navGrid('#myPager', {
            edit: false,
            add: false,
            del: true,
            search: true,
            deltext: "Apaga",
            searchtext: "Busca",
            viewrecords: true
        }
        );
    });


</script>


<table id="myGrid"></table>
<div id="myPager"></div>

<br />
<br />

这是显示的内容(根本没有图标):

enter image description here

感谢您提供任何帮助。

2 个答案:

答案 0 :(得分:4)

我认为您以错误的方式将jQuery UI添加到项目中。您应该验证文件夹/Content/themes/(来自哪个jquery-ui.css)包含带有PNG文件的子文件夹images

答案 1 :(得分:0)

对我来说真的很头疼,为了解决这个问题,首先要找一个Jquery的DEMO工作网格寻呼机,如: http://www.trirand.com/blog/phpjqgrid/examples/loading_data/million_sql/default.php

,在firefox中我点击了“inspect element”(在按钮中),然后我在url图像中搜索文件,然后我将文件复制到我的机器中;然后在我的proyect中我点击了“看背景图片”(按钮);那是我正在寻找的正确名称。重命名是否必要,将该图像放入:.. \ Styles \ images \

那就是解决方案,

“Omar Romero,墨西哥城”