mleibman / SlickGrid

A lightning fast JavaScript grid/spreadsheet
http://wiki.github.com/mleibman/SlickGrid
MIT License
6.81k stars 1.98k forks source link

using pager can't select row except the first page #1139

Open lzuliuyun opened 7 years ago

lzuliuyun commented 7 years ago

I use the pager plugin, and want to select row after initializing the grid.

when I select the row in the second page, it does't work。

example code:
https://github.com/mleibman/SlickGrid/blob/gh-pages/examples/example4-model.html

I test by this code.

  $("#btnSelectRows").click(function () {
    if (!Slick.GlobalEditorLock.commitCurrentEdit()) {
      return;
    }

    var rows = [];
    // for (var i = 0; i < 10 && i < dataView.getLength(); i++) {
    //   rows.push(i);
    // }

    grid.setSelectedRows([30,31]);
  });

so how can I solve this bug?

lzuliuyun commented 7 years ago

I find the solution, after initializing gird, then select the row.