Author Topic: selectionModel - toggle - BUG  (Read 315 times)

jplevene

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 95
    • View Profile
selectionModel - toggle - BUG
« on: March 16, 2024, 01:08:27 am »
When I have the option set as:
Code: [Select]
selectionModel: {type:"row", mode:"single", column:false, all:false, toggle:false}Double clicking an unselected row makes it unselected even though the toggle is off.

The following is stated in the API for toggle:true: "simple click on selected row removes it from selection".  However that is the case even if toggle is false


jplevene

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 95
    • View Profile
Re: selectionModel - toggle - BUG
« Reply #1 on: March 17, 2024, 11:48:51 pm »
There is a hack, but it is not ideal as it fires off select change events when there shouldn't be any.  The hack is to add the following option:

Code: [Select]
rowClick: function(event, ui) {
var sel = $("#grid").pqGrid("SelectRow");
if( !sel.isSelected({rowIndx:ui.rowIndx }) )
sel.add({rowIndx:ui.rowIndx});
}

the "toggle" option in "selectionModel" when "false" should not toggle the row/cell selection when a selected row/cell is clicked

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6255
    • View Profile
Re: selectionModel - toggle - BUG
« Reply #2 on: March 18, 2024, 07:48:38 am »
Thank you for reporting the issue. I'm able to reproduce the issue, moving it to Bug Log Board.

Sorry about the confusion. Selection row toggle is working as documented and intended, so it's not a bug.
« Last Edit: August 20, 2024, 07:23:36 pm by paramvir »