Search code examples
javascriptjqgrid

jqGrid pager doesn't display when its id has special characters


jqGrid pager doesn't display when its id has special characters.

Compare the following working example, where the pager id is simpleGridPager and is displayed correctly (see it on jsFiddle):

$(document).ready(function () {
    $("#simpleGrid").jqGrid({
      data: [
          { firstName: "john", lastName: "lennon"},
          { firstName: "ringo", lastName: "starr"}
      ],
      colNames: ["First Name", "Last Name"],
      colModel: [
          {name: "firstName", index: "firstName", stype: "text"}, 
          {name: "lastName", index: "lastName", stype: "text"}
      ],
      rowNum: 5,
      rowList: [5, 10, 15],
      datatype: 'local',
      loadonce: true,
      editurl: 'clientArray',
      pager: "#simpleGridPager",
      pgbuttons: true,
      autowidth: true,
      viewrecords: true,
    });
});
<div>
  <table id="simpleGrid"></table>
  <div id="simpleGridPager"></div>
</div>

... to the following non-working example, where the pager id is simple.GridPager (has a dot), and is not displayed (see it on jsFiddle):

$(document).ready(function () {
    $("#simpleGrid").jqGrid({
      data: [
          { firstName: "john", lastName: "lennon"},
          { firstName: "ringo", lastName: "starr"}
      ],
      colNames: ["First Name", "Last Name"],
      colModel: [
          {name: "firstName", index: "firstName", stype: "text"}, 
          {name: "lastName", index: "lastName", stype: "text"}
      ],
      rowNum: 5,
      rowList: [5, 10, 15],
      datatype: 'local',
      loadonce: true,
      editurl: 'clientArray',
      pager: "#simple.GridPager", // <-- has a dot
      pgbuttons: true,
      autowidth: true,
      viewrecords: true,
    });
});
<div>
  <table id="simpleGrid"></table>
  <div id="simple.GridPager"></div>
</div>

I'm using jqGrid 5.3.2, and hope to find a fix for this library (i.e., alternatives such as "free jqGrid" are currently irrelevant).

How can I fix this bug?


Solution

  • The problem is fixed in GitHub. Please let us know if it is fixed for you.