ethrbunny
ethrbunny

Reputation: 10469

jqGrid - unable to display advanced search dialog

Am loading ~6K rows via php/PDO. Search button appears in nav toolbar but does nothing when clicked.

Includes:

<link href="//ajax.googleapis.com/ajax/libs/jqueryui/1/themes/smoothness/jquery-ui.css" type="text/css" rel="stylesheet" />
<link href="//cdn.jsdelivr.net/jqgrid/4.6.0/css/ui.jqgrid.css" type="text/css" rel="stylesheet"/>
<link href="//cdn.jsdelivr.net/jqgrid/4.6.0/plugins/searchFilter.css" rel="stylesheet" type="text/css">
<link href="//cdnjs.cloudflare.com/ajax/libs/jqgrid/4.6.0/plugins/ui.multiselect.css" rel="stylesheet" type="text/css"/>

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jqgrid/4.6.0/plugins/ui.multiselect.js"></script>
<script src="//cdn.jsdelivr.net/jqgrid/4.6.0/i18n/grid.locale-en.js" ></script>
<script src="//cdn.jsdelivr.net/jqgrid/4.6.0/jquery.jqGrid.src.js"></script>
<script src="//cdn.jsdelivr.net/jqgrid/4.6.0/plugins/grid.addons.js"></script>
<script src="//cdn.jsdelivr.net/jqgrid/4.6.0/plugins/grid.postext.js"></script>
<script src="//cdn.jsdelivr.net/jqgrid/4.6.0/plugins/grid.setcolumns.js"></script>
<script src="//cdn.jsdelivr.net/jqgrid/4.6.0/plugins/jquery.contextmenu.js"></script>
<script src="//cdn.jsdelivr.net/jqgrid/4.6.0/plugins/jquery.searchFilter.js"></script>

Grid is defined as:

var grid = $("#list2");

grid.jqGrid({
    url: "loadIssues.php",
    datatype: "json",
    colModel: [

 ...
                    ],
    pager: "#pager2",
    viewrecords: true,
    sortorder: "desc",
    gridview: true,
    autoencode: true,
    ignoreCase : true,
    loadonce : true,
    width: 800,
    height: "auto",
    shrinkToFit: true,
    search: true,
    jsonReader: {
            repeatitems: false,
            root: "rows"
    },

followed by:

grid.jqGrid('navGrid','#pager2',{add:false,edit:false,del:false,search:true,refresh:false},
                    {},{},{},  {multipleSearch:true,overlay:false});

grid.searchGrid(  {multipleSearch:true,overlay:false} );

Chrome debugger doesn't show any errors.

What step(s) did I miss?

Upvotes: 0

Views: 327

Answers (1)

Oleg
Oleg

Reputation: 221997

  1. You should remove plugins/searchFilter.css, plugins/jquery.searchFilter.js. It's old searing components which are deprecated.
  2. The URL ../jqueryui/1/themes/smoothness/jquery-ui.css is very suspected. Probably it should be ../jqueryui/1.11.1/themes/smoothness/jquery-ui.css.
  3. Remove other plugins which you don't need.
  4. search: true option is probably wrong too, but it's not critical.
  5. root: "rows" property of jsonReader is default and can be removed. In the same way shrinkToFit: true option is default too (see the column "Default" in the table of option described in the documentation) and can be removed.

Upvotes: 1

Related Questions