2013-01-21 69 views

回答

3

您可以使用beforeShowSearch(!!!不是beforeshowsearch)在搜索对话框中进行更改。代码示例请参见here(如果使用最新版本的jqGrid,则可以使用this.id而不是grid[0].id)。我建议您另外使用recreateFilter: true搜索选项。

通过其中新增“搜索”按钮,导航栏的方式navGrid使用prmSearch参数width属性在其上创建了网格searchGrid方法的每次呼叫。所以,如果你将举行prmSearch,只是改变width下一个搜索对话框将使用新的宽度值:

var pSearch = { 
     recreateFilter: true, 
     multipleSearch:true, 
     width: 500 
    }; 

$("#list").jqGrid({...}); // create the grid 

$("#list").jqGrid("navGrid", "#pager", {}, {}, {}, {}, pSearch); 
// if the user opens searching dialog now the width 500 will be used 

... 
pSearch.width = 800; 
// if the user opens searching dialog now the new width 800 will be used 
+0

感谢奥列格。但问题是我没有用beforeShowSearch返回True,因此它不工作 – user1986736

+0

@ user1986736:欢迎您!如果你有任何(甚至不工作)的解决方案,你应该发布相应的代码,并写出你使用的jqGrid版本。很难猜测你有什么问题。 – Oleg

相关问题