【问题标题】:I could not able to see Add. Edit, Delete and View using JQGrid我无法看到添加。使用 JQGrid 编辑、删除和查看
【发布时间】:2011-09-13 16:45:53
【问题描述】:

我有

 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 中的空列。 供你参考

请提供您有价值的 cmets。

【问题讨论】:

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


    【解决方案1】:

    在我看来,您尝试使用来自the answermy demo

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

    【讨论】:

    • 我已经验证了所有的 CSS 和图像都在那里,我还添加了它的参考。
    • @imdadhusen:这必须有所不同。我的演示有效。如果您的演示可以从 Internet 访问,您可以发布 URL。如果没有,您可以上传您的演示项目并发布 URL。
    • @imdadhusen:我不知道。我有我的网络服务器。您应该在互联网上搜索任何免费的数据上传服务器。
    • 感谢您的宝贵建议!
    • @imdadhusen:我知道互联网上有很多地方可以上传数据。只需使用谷歌。我只能在与您一样有更多专业知识或经验的主题上为您提供帮助,但如果我不知道什么,我就写这个。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多