我无法看到添加。使用JQGrid编辑,删除和查看

时间:2011-06-13 05:48:36

标签: asp.net asp.net-mvc jqgrid

我有

 jQuery(document).ready(function () {
        jQuery("#list").jqGrid({
            url: '/TabMaster/GetGridData',
            datatype: 'json',
            mtype: 'GET',
            colNames: ['col ID', 'First Name', 'Last Name', '', '', '', ''],
            colModel: [
                  { name: 'colID', index: 'colID', width: 100, align: 'left' },
                  { name: 'FirstName', index: 'FirstName', width: 150, align: 'left' },
                  { name: 'LastName', index: 'LastName', width: 300, align: 'left' },
                  { name: 'add', width: 18, sortable: false, search: false,
                      formatter: function () {
                          return "<span class='ui-icon ui-icon-plus'></span>"
                      }
                  },
                  { name: 'edit', width: 18, sortable: false, search: false,
                      formatter: function () {
                          return "<span class='ui-icon ui-icon-pencil'></span>"
                      }
                  },
                  { name: 'del', width: 18, sortable: false, search: false,
                      formatter: function () {
                          return "<span class='ui-icon ui-icon-trash'></span>"
                      }
                  },
                  { name: 'details', width: 18, sortable: false, search: false,
                      formatter: function () {
                          return "<span class='ui-icon ui-icon-document'></span>"
                      }
                  }
                ],
            onSelectRow: function (rowJsonId)
            { handleSelectedRow(rowJsonId); },
            pager: jQuery('#pager'),
            rowNum: 4,
            rowList: [1, 2, 4, 5, 10],
            sortname: 'colID',
            sortorder: "asc",
            viewrecords: true,
            gridview: true,
            rownumbers: true,
            multiselect: true,
            imgpath: '/scripts/themes/steel/images',
            caption: 'Tab Master Information'
        }).navGrid(pager, { edit: true, add: true, del: true, refresh: true, search: true });
    });

    function handleSelectedRow(thing) {
    }

但我无法看到添加,编辑,删除和查看的按钮,我只能看到JQGrid中的空列。 供你参考 I am not able to see ADD, EDIT, DELETE and VIEW

请提供您宝贵的意见。

1 个答案:

答案 0 :(得分:2)

在我看来,您尝试使用my demo中的the answer

enter image description here

ui-icon-plusui-icon-trash等所有类都来自jQuery UI CSS。您应该验证是否正确地将jQuery UI与images子目录一起包含在内。