jqGrid:禁用搜索框2 [英] jqGrid: search box is disabled 2

查看:113
本文介绍了jqGrid:禁用搜索框2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我正在与之抗争的另一个例子......

Here is one more example I'm fighting with...

$("#list").jqGrid({
    url: 'AjaxFunctions.asmx/TestMethod',
    datatype: 'json',
    mtype: 'POST',
    ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
    //postdata: { _search: "true" },
    multiselect: true,
    //postData: { "filters": jsonData},
    serializeGridData: function (postData) {
        if (postData.filters === undefined) postData.filters = null;
        return JSON.stringify(postData);
    },
    jsonReader: {
        root: function (obj) { return obj.d.rows; },
        page: function (obj) { return obj.d.page; },
        total: function (obj) { return obj.d.total; },
        records: function (obj) { return obj.d.records; }
    },
    // you can also use following more simple form of jsonReader instead:
    // jsonReader: { root: "d.rows", page: "d.page", total: "d.total",
    //               records: "d.records", id: "d.names" }
    colNames:['Name', 'Title'],
    colModel: [
        { name: 'name', label: 'Name', width: 250 },
        { name: 'title', label: 'Title', width: 250 }
    ],
    rowNum: 10,
    rowList: [10, 20, 300],
    sortname: 'name',
    sortorder: "asc",
    pager: $("#pager"),
    viewrecords: true,
    gridview: true,
    rownumbers: true,
    height: 250,
    imgpath: '../css/images',
    caption: 'My first grid'
}).jqGrid('navGrid', '#pager', {edit: false, add: false, del: false, search: true});

});

我的问题是当我点击搜索按钮时,它会显示搜索框,但禁用网格和搜索框

My problem is when i click on search button it shows search box, but disable the grid and search box as well.

推荐答案

如果您添加 overlay:false 搜索选项的属性:

If you add overlay:false property of the search options:

$("#list").jqGrid('navGrid','#pager',{edit:false,add:false,del:false},{},{},{},
                  {multipleSearch:true,overlay:false});

jqGrid不会在网格上创建叠加层,搜索对话框将阻止网格。

the jqGrid will not create overlay over the grid and the search dialog will bot block the grid.

我想你的主要问题是你选择的jqGrid组件列表已下载 jquery.jqGrid.min.js。该文件至少应包含grid.base.js; grid.common.js; grid.formedit.js; jquery.searchFilter.js组件。如果在文本编辑器中打开jquery.jqGrid.min.js,您将在注释中看到所有jqGrid组件(搜索* Modules:文本)。如果您在jquery.jqGrid.min.js副本中的模块中找不到一个,则应再次下载 jqGrid选择更多模块。

I suppose that your main problem is in the list of jqGrid components which you selected as you downloaded the jquery.jqGrid.min.js. The file should contain at least grid.base.js; grid.common.js; grid.formedit.js; jquery.searchFilter.js components. If you open jquery.jqGrid.min.js in the text editor you will see all jqGrid components in the comment (search for "* Modules:" text). If you will not find one from the modules in your copy of jquery.jqGrid.min.js you should download the jqGrid one more time selecting more modules.

另一个可能的原因可能是您使用的CSS中存在一些冲突。尝试在可能的纯网页上重现问题,然后使用所有CSS逐步进入当前页面。

Another possible reason can be some conflict in CSS which you use. Try reproduce the problem on possible pure web page and then go step by step to your current page with all CSS.

这篇关于jqGrid:禁用搜索框2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆