Author Topic: about selectionModel's block  (Read 404 times)

tbum

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 11
    • View Profile
about selectionModel's block
« on: June 30, 2022, 02:12:46 pm »
Code: [Select]

            selectionModel: {type: 'cell', mode: 'block', row: true, toggle: true,},

I have specified selectionModel as above.
What I want to do is make a block so that only cells in the same row as the cell that started the first selection are selected.
What can I do?
And no event handlers like beforeSelectChange ? This is to be able to invalidate when an unwanted area is selected.


The exact function I want to make is that I want the selectModel to work only for a specific area. Do you offer such a feature as an option?
Otherwise, I tried to develop it using an event handler.
« Last Edit: June 30, 2022, 03:26:09 pm by tbum »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: about selectionModel's block
« Reply #1 on: July 01, 2022, 12:07:14 pm »
There is no beforeSelectChange event but the selection can be adjusted in selectEnd event as per your requirement.

Code: [Select]
selectEnd: function(evt, ui){
debugger;
var address = ui.selection.address()[0];
this.Range({r1: address.r1, c1: address.c1, rc:1, cc: address.cc}).select();
}