Skip to content
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

[RFR] Add edition and creation hooks #898

Merged
merged 1 commit into from
Jan 20, 2016
Merged

Conversation

fzaninotto
Copy link
Member

Closes #805, #862, #782, #777.

See updated doc for details.

fzaninotto added a commit that referenced this pull request Jan 20, 2016
[RFR] Add edition and creation hooks
@fzaninotto fzaninotto merged commit 6d74cf7 into master Jan 20, 2016
@fzaninotto fzaninotto deleted the edition_creation_hooks branch January 20, 2016 13:54
@mRoca
Copy link

mRoca commented Jan 25, 2016

Great job ! Thanks a lot :)

@windmaomao
Copy link

When you invoke this onSubmitSuccess, can you pass in the previousState as well ?


            .then(entry => view.onSubmitSuccess() && this.$injector.invoke(
                view.onSubmitSuccess(),
                view,
                { previousState, $event, entity: this.entity, entry, controller: this, form: this.form, progression, notification }
            ))

because if we pass that, then i can do the redirect to save all list filter parameters, as


        editionView.onSubmitSuccess(['previousState', 'progression', 'notification', '$state', 'entry', 'entity', function(previousState, progression, notification, $state, entry, entity) {
            // stop the progress bar
            progression.done();
            // add a notification
            notification.log(`Element #${entry._identifierValue} successfully edited.`, { addnCls: 'humane-flatty-success' });
            // redirect to the list view
            $state.go(previousState.name, previousState.params);
            // cancel the default action (redirect to the edition view)
            return false;
        }])

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.

3 participants