2013-01-21 95 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

相關問題