Author Topic: Multi-selection fails with initial selection  (Read 45 times)

Mikael Andersen

  • Pro OEM
  • Newbie
  • *
  • Posts: 9
    • View Profile
Multi-selection fails with initial selection
« on: July 02, 2026, 07:11:54 pm »
Hi at pqgrid,

We experienced a problem with initial selection being set and the use of "Shift+click" to do multi-cell selection.
Its reproducable in demo following these steps,

* Open demo: https://paramquery.com/pro/demos/grid_parts
* Insert this line after creating grid, f.x. on line 102: grid.setSelection({ rowIndx: 0, colIndx: 0})
* Run (top, leftmost cell is selected as expected)
* Hold shift and click on a different cell to do a block selection

Nothing happens and this error is displayed in console:
Uncaught TypeError: can't access property "r1", n is undefined
    resize https://paramquery.com/pro2/content/js11.2.0/pqgrid.min.js?4:32
    resizeOrReplace https://paramquery.com/pro2/content/js11.2.0/pqgrid.min.js?4:32
    onCellMouseEnter https://paramquery.com/pro2/content/js11.2.0/pqgrid.min.js?4:32
  ...

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6552
    • View Profile
Re: Multi-selection fails with initial selection
« Reply #1 on: July 03, 2026, 05:25:51 pm »
Please use grid.Range() API instead of setSelection.

Code: [Select]
        grid.Range({
            r1: 0,
            c1: 0,
            firstR:0,
            firstC:0
        }).select();

Ref: https://paramquery.com/pro/api#method-Range
« Last Edit: July 03, 2026, 05:27:24 pm by paramvir »