feat: add new Cell/Row override to Hybrid Selection Model #1160
+120
−64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
add a
selectionType(can be one of'cell', 'row', 'mixed'), by default it's mixed and also the'cell'doesn't do much except ignorerowSelectColumnIdswhen provided. But the'row'type is really the one I wanted to add and that I need in order to fully replace the Cell & Row Selection Models (which is what I'll do in my next Slickgrid-Universal major version, I'll delete previous models and only keep the new Hybrid in my project, thanks to @6pac for this new hybrid model). So the new'row'fixes an issue that the new Hybrid Selection had some problems with, which was that unless you're on therowSelectColumnIdscolumn, then it defaults to a cell selection, but in some grids the user may want to use the new Hybrid Model but really use it as a Row Selection only and we'll now be able to do this via{ selectionType: 'row' }as Hybrid Model option.... in other words, it's exactly as if we were using the previous
SlickRowSelectionModel, but in reality we are using the newSlickHybridSelectionModel({ selectionType: 'row' })with a new selection type option. So this is great if we want to have the same previous behavior but with the new model (which is what I wanted)Previous code, without fully hybrid but not exactly great for row selection
With new option
{ selectionType: 'row' }, we now explicitely use a Row Selection even with the Hybrid Model