2015-11-29 21 views
0

我有一個的jqGrid與說3列1)ID,2)國家,3說明外部過濾器下拉菜單對的jqGrid

id| country | Description 
 
1 | France | this is just a test  
 
2 | China | this is just a test 
 
3 | Russia | this is just a test 
 
4 | France | this is just a test 
 
5 | France | this is just a test

現在所需要的是它含有一個外部選擇下拉獨特的國名

像上面的下拉值將 法國 中國 俄羅斯

1)是否有可能通過Jquery或沒有數據庫命中的東西來填充下拉菜單? 2)這將是簡單的,但在選擇電網需要過濾,爲國家選擇

選擇下拉是在頁面的外部,而不是jqGrid的

回答

0

你使用哪種datatype裏面?您使用哪個版本和jqGrid分支(free jqGrid,Guriddo jqGrid JS或某些舊的jqGrid版本< = 4.7)?

一般而言,您可以按照the answer(修改​​)中描述的想法在列中生成唯一值,並在select或autocomplete中使用該值。舊的答案使用內部選擇和輸入the filter toolbar,但您可以以相同的方式使用外部元素。

One more demothe answer使用select2控制,我個人喜歡。它具有選擇和自動完成的優點。