开发者

jqGrid: search box is disabled 2

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

$("#list").jqGrid({
    url: 'AjaxFunctions.asmx/TestMethod',
    datatype: 'json',
    mtype: 'POST',
    ajaxGridOptio开发者_Python百科ns: { 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.


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

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

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

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.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜