我一直在玩jqGrid,但无法找出如何实现搜索功能。理想情况下,我想使用“高级搜索” - 我想当用户提交高级搜索表单时,输入的数据会被触发到'editurl'下特定的网址?我猜这个URL然后输出使用搜索条件过滤的结果集。
我的问题是,这是如何实际完成的?我是否正确地将URL数据发送到了,如果有的话,如何访问这些数据?
在jQuery中相当体面,擅长JavaScript-我使用PHP的所有服务器端的东西(专家知识和mySQL),但不能为我的生活似乎工作了这一点......目前我的Java是:
如何使用jqGrid高级搜索/ w Serverside PHP?
var lastsel;
$("#list").jqGrid({
url:'example.php',
datatype: 'xml',
hidegrid: false,
mtype: 'GET',
colNames:['id','ti', 'na','al','de'],
colModel :[
{name:'id', index:'id', width:55, hidden:true, key:true, resizable:true},
{name:'ti', index:'ti', width:75, resizable:true,editable:true},
{name:'na', index:'na', width:200, align:'left', resizable:true,editable:true},
{name:'al', index:'al', width:200, align:'left', resizable:true,editable:true},
{name:'de', index:'de', width:400, align:'left', sortable:false, resizable:true,editable:true}
],
pager: '#pager',
height:'100%',
rowNum:10,
searchGrid: {multipleSearch:true, caption : 'go'},
rowList:[50,100,200],
sortname: 'ticker',
sortorder: 'asc',
viewrecords: true,
editurl:'example.php',
multipleSearch:true,
caption: 'Definitions'
});
所有帮助非常感谢!
感谢您的回复,并表示歉意,Java是一个用词不当 - 我知道它的Javascript(如最初指出)。 我知道你可以使用$ _GET ['Oper'](和类似的)在php中获取搜索条件,术语等,但是高级搜索如何表示/传递数据?我想它在一个数组中,但该数组是如何构造的? (即序列化等)。 – Sam 2010-01-08 10:32:51
我没有找到任何searchGrid的文档(在你的例子中使用过)。但在http://trirand.com/blog/jqgrid/jqgrid.html中有使用php进行搜索的演示。你看了一下吗? – 2010-01-08 17:11:57