将搜索下拉列入网格

时间:2013-01-17 15:56:58

标签: jquery jqgrid

我有一个网格,其中包含用于搜索的文本框。对于客户,我想添加一个向下而不是文本框。有什么建议?感谢

        <table id="customer_list" class="scroll jqTable" cellpadding="0" cellspacing="0"></table>
        <!-- pager will hold our paginator -->
        <div id="customer_list_pager" class="scroll" style="text-align:center;"></div>
<script type="text/javascript">
        /* when the page has finished loading.. execute the follow */
        $(document).ready(function () {
            jQuery("#customer_list").jqGrid({
              url:'jq_customer_list',
              datatype: "json",
              colNames:['Customer','Application','Location','Product','id'],
              colModel:[
                {name:'Customer'},
                {name:'Application'},
                {name:'Location'},
                {name:'Product'},
                {name:'id', hidden:true}
              ],
              rowNum:1,
              rowList:[1,2,3,4],
              pager: jQuery('#customer_list_pager'),
              viewrecords: true,
              gridview: true
            });
            $("#customer_list").jqGrid('filterToolbar',{autosearch:true});
        });
        </script>

1 个答案:

答案 0 :(得分:0)

添加

{name:'location',stype:'select', searchoptions:   {value:':All;USA:USA;Canada:Canada;Carribean:Carribean;USPacific:USPacific;'}},

你得到你的下拉列表