Author Topic: Add a selectionModel.mode = "none"  (Read 246 times)

jplevene

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 99
    • View Profile
Add a selectionModel.mode = "none"
« on: June 29, 2024, 12:03:43 am »
Adding a selectionModel.mode = "none" prevents rows, cells, columns, etc. from being selected which makes it good for a selector when there are checkboxes.

For example if I had a tree with checkboxes on each node and all I am using the tree for is selecting checkboxes, selecting a row, column or cell is of no use.  This is evident on column filters (see here https://paramquery.com/pro/demos), there is no point having a selected row in the drop down filter.

Also it would be nice to have an option when clicking the whole row (outside the text) to select/deselect the checkbox

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6260
    • View Profile
Re: Add a selectionModel.mode = "none"
« Reply #1 on: July 31, 2024, 04:16:44 pm »
This feature is already present in the grid.

selection of rows, cells, columns, etc. can be prevented by setting selectionModel.type = null

jplevene

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 99
    • View Profile
Re: Add a selectionModel.mode = "none"
« Reply #2 on: July 31, 2024, 06:18:31 pm »
Sorry, it didn't work in columnModel

Code: [Select]
selectionModel: {type:null},

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6260
    • View Profile
Re: Add a selectionModel.mode = "none"
« Reply #3 on: July 31, 2024, 06:52:02 pm »
To disable spreadsheet like row and column selections ( by clicking on the headers ), please set selectionModel.row and selectionModel.column to false

It's better to refer the API docs:

https://paramquery.com/pro/api#option-selectionModel
« Last Edit: July 31, 2024, 06:55:16 pm by paramvir »

jplevene

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 99
    • View Profile
Re: Add a selectionModel.mode = "none"
« Reply #4 on: July 31, 2024, 07:14:48 pm »
Thanks
« Last Edit: July 31, 2024, 07:18:22 pm by jplevene »