Skip to content

feat: provide default callbacks for Row Move plugin when null#2577

Merged
ghiscoding merged 3 commits into
masterfrom
feat/move-row-utils
May 9, 2026
Merged

feat: provide default callbacks for Row Move plugin when null#2577
ghiscoding merged 3 commits into
masterfrom
feat/move-row-utils

Conversation

@ghiscoding

@ghiscoding ghiscoding commented May 9, 2026

Copy link
Copy Markdown
Owner

provide default implementation for Row Move callback handlers with onBeforeMoveRows and onMoveRows but only when user doesn't provide any themselves. So this won't be a breaking change and the user can provide custom logic if wanted. The goal of this new feature is really to avoid having to re-implement the same logic over and over for every grid that we want to use Row Move since it's roughly the same code logic (it's always the same in the demos anyway)

Note: these new default implementation won't work with Tree Data, but that's rarely used anyway, and if that happens then the end user will still have to provide their own custom code for both onBeforeMoveRows and onMoveRows callbacks

So user can now delete their implementation and fallback to the defaults (this is optional, user who decide to keep their implementation will still work as intended, the defaults are just fallbacks and are now part of the lib):

this.gridOptions = {
   // ...
    enableRowMoveManager: true,
    rowMoveManager: {
      columnIndexPosition: 0,
      // when using Row Move + Row Selection, you want to move only a single row and we will enable the following flags so it doesn't cancel row selection
        singleRowMove: true,

      // optionally remove your previous code and use default callbacks
-     onBeforeMoveRows: this.onBeforeMoveRow.bind(this),
-     onMoveRows: this.onMoveRows.bind(this),

      // there is also a new optional callback to get update dataset after the move
+    onAfterMoveRows: (_e, args) => {
+      this.dataset = args.updatedItems;
+    },
  };
}

- onBeforeMoveRow(e, args) {
-   // ...
- }

- onMoveRow(e, args) {
-   // ...
- }

@codecov

codecov Bot commented May 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (e60ca58) to head (50babfd).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2577   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files         196      197    +1     
  Lines       25279    25325   +46     
  Branches     8922     8934   +12     
=======================================
+ Hits        25279    25325   +46     
Flag Coverage Δ
angular 100.0% <ø> (ø)
universal 100.0% <100.0%> (ø)

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.

@ghiscoding ghiscoding changed the title feat: provide default implementation for Row Move handler w/null feat: provide default callbacks for Row Move plugin when null May 9, 2026
@pkg-pr-new

pkg-pr-new Bot commented May 9, 2026

Copy link
Copy Markdown
angular-slickgrid

npm i https://pkg.pr.new/angular-slickgrid@2577

aurelia-slickgrid

npm i https://pkg.pr.new/aurelia-slickgrid@2577

slickgrid-react

npm i https://pkg.pr.new/slickgrid-react@2577

slickgrid-vue

npm i https://pkg.pr.new/slickgrid-vue@2577

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

npm i https://pkg.pr.new/@slickgrid-universal/angular-row-detail-plugin@2577

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

npm i https://pkg.pr.new/@slickgrid-universal/aurelia-row-detail-plugin@2577

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

npm i https://pkg.pr.new/@slickgrid-universal/react-row-detail-plugin@2577

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

npm i https://pkg.pr.new/@slickgrid-universal/vue-row-detail-plugin@2577

@slickgrid-universal/binding

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

@slickgrid-universal/common

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

@slickgrid-universal/composite-editor-component

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

@slickgrid-universal/custom-footer-component

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

@slickgrid-universal/custom-tooltip-plugin

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

@slickgrid-universal/empty-warning-component

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

@slickgrid-universal/event-pub-sub

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

@slickgrid-universal/excel-export

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

@slickgrid-universal/graphql

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

@slickgrid-universal/odata

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

@slickgrid-universal/pagination-component

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

@slickgrid-universal/pdf-export

npm i https://pkg.pr.new/@slickgrid-universal/pdf-export@2577

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

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

@slickgrid-universal/rxjs-observable

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

@slickgrid-universal/sql

npm i https://pkg.pr.new/@slickgrid-universal/sql@2577

@slickgrid-universal/text-export

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

@slickgrid-universal/utils

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

@slickgrid-universal/vanilla-bundle

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

@slickgrid-universal/vanilla-force-bundle

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

commit: 50babfd

@ghiscoding ghiscoding merged commit 6e866a2 into master May 9, 2026
24 checks passed
@ghiscoding ghiscoding deleted the feat/move-row-utils branch May 9, 2026 15:25
@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

🎉 This pull request is included in version 10.7.0 📦
🔗 The release notes are available at: GitHub Release 🚀

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.

2 participants