如何让jqGrid工具条搜索工作? [英] How can I get jqGrid toolbar search working?

查看:157
本文介绍了如何让jqGrid工具条搜索工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://trirand.com/blog/jqgrid/jqgrid.html 在新版本3.7>列搜索中,有一种解释方法进行搜索,并没有为我工作。我添加了:

At http://trirand.com/blog/jqgrid/jqgrid.html, under "New in Version 3.7" > "Column Search", there is a method explained to search, and it hasn't worked yet for me. I've added:

jQuery("#toolbar").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false});

而不是基本代码。我的服务器看到略微不同的JSON请求,但没有 _search = true ,没有搜索字词。

and less essential code from the example. My server saw slightly different JSON requests, but no _search=true and no search term, ever.

http://trirand.com/blog/jqgrid/jqgrid.html 也给出了一个不完整的例子服务器端代码。 SQL语句在示例PHP中给出:

http://trirand.com/blog/jqgrid/jqgrid.html also gives an incomplete example of server-side code. The SQL statement is given in the example PHP:

$SQL = "SELECT item_id, item, item_cd FROM items ".$where." ORDER BY $sidx $sord LIMIT $start , $limit";

但是,而 $ sidx $ sord $ start $ limit 都有代码定义它们, $其中未定义(或引用)页面上的其他任何地方。

but, while $sidx, $sord, $start, and $limit all have code to define them, $where is not defined (or referenced) anywhere else on the page.

如何获取一个列搜索类似于页面文档,我的服务器正在被适当的请求命中?

How can I get a column search like the page documents, where my server is being hit by the appropriate requests?

推荐答案

filterToolbar 方法。看看工作示例使用它。

我不能帮你解决问题的PHP部分,因为我自己不使用PHP。不过,演示文件来自 jqGrid下载页面似乎包含一些可能对您有帮助的PHP代码示例。

I can't help you with the PHP part of your question, because I don't use PHP myself. Nevertheless the demo files from the jqGrid download page seems to contain some PHP code examples which could be helpful for you.

这篇关于如何让jqGrid工具条搜索工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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