做你需要的最简单的方法是
var grid = $("#list"),
prmSearch = {multipleSearch:true,overlay:false};
grid.jqGrid({
// all jqGrid parameters
});
// next line is optional
grid.jqGrid('navGrid','#pager',
{add:false,edit:false,del:false,search:true,refresh:true},
{},{},{},prmSearch);
// create the searching dialog
grid.searchGrid(prmSearch);
// find the div which contain the searching dialog
var searchDialog = $("#fbox_"+grid[0].id);
// make the searching dialog non-popup
searchDialog.css({position:"relative", "z-index":"auto"});
您可以实时查看结果here http://www.ok-soft-gmbh.com/jqGrid/MultisearchFilterAboveGrid0.htm。要消除搜索对话框和网格的边框,您还可以执行以下操作:
searchDialog.addClass("ui-jqgrid ui-widget ui-widget-content ui-corner-all");
searchDialog.css({position:"relative", "z-index":"auto", float:"left"})
var gbox = $("#gbox_"+grid[0].id);
gbox.before(searchDialog);
gbox.css({clear:"left"});
它将搜索对话框移到“gbox_list”div 之外。
最终解决方案你可以看到here http://www.ok-soft-gmbh.com/jqGrid/MultisearchFilterAboveGrid.htm.