Skip to content

Conversation

ghiscoding
Copy link
Owner

@ghiscoding ghiscoding commented Sep 17, 2025

Thanks to Ben (6pac) for starting this new feature in SlickGrid repo:

New HybridSelectionModel combines cell and row selection models. It functions like CellSelectionModel except when certain conditions switch it into RowSelectionModel. If the options.rowSelectOverride function exists, then HybridSelectionModel calls it expecting a boolean return to determine whether to behave like RowSelectionModel. If this option is not set, then selection of a column that is a member of the array options.rowSelectColumnObjectArr will be treated with the behaviour of RowSelectionModel.

Drag and Replace option mirrors Excel as closely as possible. When a range of cells is selected, a grey box appears at the bottom right of the selection area, and dragging that grey box expands the selection area and replaces the newly selected cells will the contents of the existing cells. Excel specifically only allows expansion horizontally or vertically, but here we allow both. The current behaviour may be modified. Note that the spreadsheet example the FormulaEditor causes problems with this new feature because it creates a new CellRangeSelector each time a cell is edited. This editor needs to add an event to the existing grid's CellRangeSelector, or create a new one.

It's still at the very early stage and there's thing that would need a bit of polishing

TODOs

  • add new Hybrid Model
  • add 2 new Examples
  • add Cypress E2E tests for both examples
  • add full unit test coverage
  • add Hybrid Mode to Extension Service
  • use rowSelectionOptions grid options as plugin options
  • drag-shrink is not behaving as a user would expect (not like Excel)
  • replicate 2 new Examples to all frameworks
  • is this new HybridSelectionModel a complete merge of the previous 2 models? If so, can we get rid of the 2 and only keep this new one? We might need to keep it as trial until next major

SlickPR_DragFill_Hybrid

brave_qEVtlmknGY

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@ghiscoding ghiscoding marked this pull request as draft September 17, 2025 04:18
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

❌ Patch coverage is 32.25806% with 483 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.7%. Comparing base (b971b11) to head (c6295f8).

Files with missing lines Patch % Lines
...common/src/extensions/slickHybridSelectionModel.ts 11.8% 367 Missing ⚠️
packages/common/src/core/slickCore.ts 35.1% 87 Missing ⚠️
packages/common/src/core/slickGrid.ts 72.5% 11 Missing ⚠️
...es/common/src/extensions/slickCellRangeSelector.ts 82.9% 11 Missing ⚠️
...kages/common/src/extensions/slickRowMoveManager.ts 33.4% 4 Missing ⚠️
packages/common/src/core/slickInteractions.ts 78.6% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #2162     +/-   ##
========================================
- Coverage   100.0%   98.7%   -1.3%     
========================================
  Files         197     198      +1     
  Lines       36196   36854    +658     
  Branches    10743   10776     +33     
========================================
+ Hits        36196   36371    +175     
- Misses          0     483    +483     
Flag Coverage Δ
angular 100.0% <ø> (ø)
universal 98.7% <32.3%> (-1.3%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

pkg-pr-new bot commented Sep 17, 2025

angular-slickgrid

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/angular-slickgrid@2162

aurelia-slickgrid

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/aurelia-slickgrid@2162

slickgrid-react

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/slickgrid-react@2162

slickgrid-vue

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/slickgrid-vue@2162

@slickgrid-universal/binding

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/binding@2162

@slickgrid-universal/common

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/common@2162

@slickgrid-universal/composite-editor-component

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/composite-editor-component@2162

@slickgrid-universal/custom-footer-component

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/custom-footer-component@2162

@slickgrid-universal/custom-tooltip-plugin

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/custom-tooltip-plugin@2162

@slickgrid-universal/empty-warning-component

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/empty-warning-component@2162

@slickgrid-universal/event-pub-sub

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/event-pub-sub@2162

@slickgrid-universal/excel-export

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/excel-export@2162

@slickgrid-universal/graphql

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/graphql@2162

@slickgrid-universal/odata

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/odata@2162

@slickgrid-universal/pagination-component

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/pagination-component@2162

@slickgrid-universal/row-detail-view-plugin

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/row-detail-view-plugin@2162

@slickgrid-universal/rxjs-observable

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/rxjs-observable@2162

@slickgrid-universal/text-export

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/text-export@2162

@slickgrid-universal/utils

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/utils@2162

@slickgrid-universal/vanilla-bundle

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/vanilla-bundle@2162

@slickgrid-universal/vanilla-force-bundle

npm i https://pkg.pr.new/ghiscoding/slickgrid-universal/@slickgrid-universal/vanilla-force-bundle@2162

commit: c6295f8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant