我有一个网格,根据下拉框中的选择填充 它工作正常,但我需要将下拉菜单修改为多选,以允许用户选择多个条目。怎么办呢?
HTML
<select name="prov_id" id="prov_id" multiple="multiple">
<option value="25_3″>agnico</option>
<option value="24_3″>agnico2</option>
</select>
SCRIPT
$myGrid.jqGrid(
{
url: myURL + '?method=GetTransactions', //CFC that will return the transactions
postData: {
prID: function() { return $("#prov_id option:selected").val(); },
mn: function() { return $("#month option:selected").val(); },
yr: function() { return $("#year option:selected").val(); }
},
//multiselect: true, //adds checkboxes in front of each line
//multiboxonly: true,
datatype: 'json', //We specify that datatype we will be using is JSON
colNames: [
'Trx ID',
'Description',
'Cheque No',
'Amount',
'Debit',
'Credit',
'Month',
'Year',
'Status',
'Added by Employee'
],
...
答案 0 :(得分:0)
如果有兴趣的话我解决了这个问题:
function getSelProv(){ return $('select#prov_id').val(); } .......
postData: {
prID: function() { return getSelProv() },
........