2011-11-17 78 views
0

,但確定這似乎並沒有什麼意義了,可惜在trirand的一個例子似乎有相同的錯誤的jqGrid - 無法填充選擇在搜索對話框 - 在工具欄

與此列模型

{name:'txtFixtureType', index:'txtFixtureType', width:110, 
stype: 'select', 
edittype:'select', editoptions: { 
value: ":All;1:Division 1;2:Division 2"}}, 

啓用工具欄搜索會爲該列選擇結果,填充值。但是,使用高級搜索對話框時,會出現選擇,但不包含任何值。

是否需要設置一些附加屬性?

回答

3

嘗試

{ name: 'txtFixtureType', index: 'txtFixtureType', width: 110, 
    edittype: 'select', 
    editoptions: { value: ":All;1:Division 1;2:Division 2" }, 
    stype: 'select', 
    searchoptions: { sopt: ['eq', 'ne'], value: ":All;1:Division 1;2:Division 2" } 
} 

此外取決於您的數據保存下來,可以根據需要使用formatter: 'select'(見the documentation)。

通常,您可以將工具欄搜索與高級搜索結合使用。請參閱the answerthe demo

+0

Duh。當然,我們需要searchoptions而不是editoptions,但是拋出我的是,對於工具欄搜索editoptions也起作用。 – Cruachan

+0

@Cruachan:您可以共享'editoptions'並將其用於搜索,但是在'選擇'不使用'editoptions'的情況下:'All'部分更有意義。一般來說,如果在搜索工具欄中jqGrid自動添加':All'或其他一些基礎,那麼效果會更好。例如,在高級搜索的情況下,不需要部分':All'。 – Oleg

相關問題