Skip to content

trigger add event on add method in w2grid.js #2623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tbmale
Copy link

@tbmale tbmale commented Apr 1, 2025

... in relation with issue #2622

@@ -498,6 +498,7 @@ class w2grid extends w2base {
} else {
this.refresh()
}
this.trigger("add", {target: this.name})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be useful to pass on record and first variables with the event, as those are arguments in the functio. Also, add spacing after { and before }

Also, I noticed that there is already an add event (search the code) and it is when add button is clicked, so event name should be addRecords,

Also, you should have event's before and after loop. See how other events are triggered, with edata.finish(). Event should be cancellable too.

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