可以让 jqGrid 搜索框留在页面上吗? [英] Possible to make jqGrid Search Box Stay on Page?

查看:20
本文介绍了可以让 jqGrid 搜索框留在页面上吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在,我必须点击 jqGrid Search 图标来弹出搜索框.我想做的是始终在网格上方打开搜索框(而不是弹出窗口).我在他们的演示中没有看到任何内容,但我希望有人已经做到了或知道如何做到.

Right now, I have to click the jqGrid Search icon to popup the search box. What I would like to do is have the search box open above the grid (not as a popup) at all times. I'm not seeing anything in their demos, but am hoping somebody has done it or knows how.

推荐答案

做你需要的最简单的方法是

The simplest way to do what you need is

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"});

您可以在此处实时查看结果.要去除搜索对话框和网格上的边框,您还可以执行以下操作:

You can see the results live here. To make away the border over the searching dialog and grid you can do additionally the following:

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 之外.

It moves the searching dialog outside of "gbox_list" div.

您可以在此处看到最终解决方案.

The end solution you can see here.

这篇关于可以让 jqGrid 搜索框留在页面上吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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