1

次のjqgridコードを使用しています:

        jQuery("#list2").jqGrid({
        url:'<?php echo $url;?>',
        datatype: "json",
        colNames:[
            <?php 
                $sep = "";
                foreach($columns as $col){
                    echo $sep . "'" . $col['header'] . "'";                         
                    $sep = ","; 
                }
            ?>
        ],
        colModel:[              
            <?php 
                $sep = "";
                foreach($columns as $col){
                    echo $sep . "{name:'" . $col['name'] . "',index:'" . $col['name'] . "', width:" . $col['width'] . ", sortable:true, search:true}"; 
                    $sep = ","; 
                }
            ?>      
        ],
    rowNum:100,
    rowList:[100,200,300,400],
    pager: '#pager2',
        loadonce: true,
        sortname: 'geneID',
        viewrecords: true,
        width:700,
        shrinkToFit:false,
        height:700,
        sortorder: "desc",
    caption:"Breeder Tool Box"
    });


jQuery("#list2").navGrid('#pager2',{add: false, edit: false, del: false,search : true ,     refresh : true},{},{},{});
jQuery("#list2").searchGrid({multipleSearch:true});  // For Adding the Multiple Search Option on the jqgrid

デフォルトでは、グリッドが読み込まれるたびに検索ボックスが開きます。

jqgridツールバーの下部にある検索オプションをクリックした後にのみ検索ボックスを取得しようとしています

私のコードで欠落している/間違っている部分を指摘していただけますか

4

1 に答える 1

2

searchGrid メソッドを参照してwikiから

Typically when this method is called it launches the modal dialog and makes it so the grid inaccessible until the dialog is closed.
This method is not the default search method in the navigator. To enable this you should either set the default search options using the extend method or set it in the navigator in the place of the search options.

したがって、グリッドに検索モーダルを割り当てるのではなく、検索モーダルを呼び出していました。代わりに、次のように複数検索を割り当てる必要があります。

jQuery("#list2").navGrid('#pager2',
{add: false, edit: false, del: false,search : true ,refresh : true},
{},
{},
{},
{multipleSearch:true});

したがって、次の行を削除する必要があります。

jQuery("#list2").searchGrid({multipleSearch:true});
于 2012-05-10T17:49:01.073 に答える