Author Topic: How to unselect a row from a block (previouly using CTRL+click on selected row)  (Read 3347 times)

easyKost

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 5
    • View Profile
Hello,

We are migration from 2.4.1 to 3.3.0.
In the version 2.4.1 we were using CTRL+click on a row to deselect one row from the whole selection. (this is a standard ergonomic behaviour for such a component).
In the version 3.3.0, such an action do nothing.

Is it a bug or is there a specific configuration to do so ?

Compare both in the demos of both version 2.2.x and version 3.3.0: selections => row selection.

Thanks for your support.

Best Regards,
easyKost

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Your concern is understandable, non-contiguous selections have been dropped from v3.

Either you can use checkbox selections or add this code to unselect rows with ctrl key.

Code: [Select]
rowClick: function(evt, ui){
if(evt.ctrlKey){
var isSel = this.selection({type:'row', method:'isSelected', rowIndx: ui.rowIndx});
isSel && this.selection({type:'row', method: 'remove', rowIndx: ui.rowIndx});
}
},

easyKost

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 5
    • View Profile
With 3.3.0 version, CTRL + click still allows us to select discontinuing row.
Your rowClick solution is a little bit anoying as far as it allows to unselect an already selected row but prevent any additionnal row selection with CTRL+clic.
With this solution, CTRL + click first select a new row and then rowClick remove this selection.

Any idea to keep selection and deselection with CTRL + click ?

Best Regards,
easyKost

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile