【问题标题】:jqGrid is displaying only "IsNull" and "Is Not Null" options in searchjqGrid 在搜索中仅显示“IsNull”和“Is Not Null”选项
【发布时间】:2018-09-10 08:54:04
【问题描述】:

我正在使用 jqGrid 4.15.6-prelocal 数据类型。我启用了multipleSearch: true,但我只得到“IsNull”和“Is Not Null”作为搜索选项。下面是我的代码

 $("#dataGrid").jqGrid({
            datatype: "local",
            data: mydata,
            colNames: ['Student_ID', 'STATUS', 'TYPE', 'DESCRIPTION', 'COPIES'],
            colModel: [
                            { name: 'Student_ID', index: 'Student_ID', width: 80},
                            { name: 'STATUS', index: 'STATUS', width: 160 },
                            { name: 'TYPE', index: 'TYPE', width: 180 },
                            { name: 'DESCRIPTION', index: 'DESCRIPTION', width: 180 },
                            { name: 'COPIES', index: 'COPIES', width: 180 }
            ],
            pager: '#pagingGrid',
            sortname: 'Student_ID',
            gridview: true,
            rownumbers: true,
            viewrecords: true,
            loadonce: true,
            gridview: true,
            sortorder: "desc",
            caption: 'Just simple local grid',
            height: '100%'
        });

        $("#dataGrid").jqGrid('navGrid', '#pagingGrid', { edit: false, add: false, del: false }, {}, {}, {}, { multipleSearch: true, closeAfterSearch: true });

【问题讨论】:

  • 听起来很奇怪。您能否提供重现问题的演示?我想你包含了错误的 JS 文件。以演示 jsfiddle.net/OlegKi/4o5hsyba 为例,它演示了免费 jqGrid 中搜索对话框的典型用法。所有搜索选项均正确显示。通常可以在colModel 的每一列定义中定义searchoptions 属性的sopt 数组或设置通用默认sopt 值。您可以将默认搜索选项列表替换为另一个(例如两个选项“IsNull”和“Is Not Null”)。
  • @Oleg 是的,问题是参考,一旦我按照你的小提琴引用文件,它就像魅力一样。谢谢..我在这里还有一个查询..我可以导出JqG​​rid 变成 excel 免费版?
  • 不客气!查看the answerthe demo,我在其中展示了如何在jqGrid 中使用SheetJS。我发布了之前的评论作为答案。在"accepting" 回答后,您将提高您的声誉。
  • @Oleg 再次感谢 ..Excel 也有效!!我们有类似的 PDF 和打印吗?
  • jqGrid 没有这样的功能。我建议您导出到 Excel 并使用 Excel 的打印/pdf 编写功能。它有许多不容易实现的有用的打印功能。或者,您可以使用任何其他有助于从 JavaScript 生成 PDF 文件的开源产品,例如 (isPDF)[parall.ax/products/jspdf]。这个想法与使用 SheetJS 的情况相同。

标签: jquery jqgrid


【解决方案1】:

听起来很奇怪。您能否提供重现问题的演示?我想你包含了错误的 JS 文件。以演示 https://jsfiddle.net/OlegKi/4o5hsyba/ 为例,它演示了免费 jqGrid 中搜索对话框的典型用法。所有搜索选项均正确显示。通常,可以在colModel 的每一列定义中定义searchoptions 属性的sopt 数组或设置通用默认sopt 值。您可以将搜索选项的默认列表替换为另一个(例如两个选项“IsNull”和“Is Not Null”)。

【讨论】:

    猜你喜欢
    • 2011-11-17
    • 2014-11-14
    • 2023-04-03
    • 1970-01-01
    • 1970-01-01
    • 2017-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多