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

Events list #909

Open
RaphGC opened this issue Feb 12, 2019 · 5 comments
Open

Events list #909

RaphGC opened this issue Feb 12, 2019 · 5 comments

Comments

@RaphGC
Copy link

RaphGC commented Feb 12, 2019

Is there a place where events fired by the plugin are listed ? documented ? :)

@Bill-Dagg
Copy link

From events.js ...

const events = {
loaded: createNewEvent('loaded'),
viewData: createNewEvent('viewData'),
userDeclined: createNewEvent('userDeclined'),
modalClosed: createNewEvent('modalClosed'),
modalOpened: createNewEvent('modalOpened'),
formSaved: createNewEvent('formSaved'),
fieldAdded: createNewEvent('fieldAdded'),
fieldRemoved: createNewEvent('fieldRemoved'),
fieldRendered: createNewEvent('fieldRendered'),*
fieldEditOpened: createNewEvent('fieldEditOpened'),
fieldEditClosed: createNewEvent('fieldEditClosed'),
}

Note: With the exception of fieldRendered, these all seem to be dispatched on the document.

@tacman
Copy link
Contributor

tacman commented Apr 17, 2020

Wouldn't it be better to dispatch the event on the DOM element or the jQuery object?

Then you could listen for events like

$('#myForm).formBuilder({})
    .on('loaded', function(event, data) { console.log(data); });

The events on the document do not appear to have any data associated with them.

@tacman
Copy link
Contributor

tacman commented Apr 17, 2020

Perhaps for a future version, the events could be more specific to formBuilder (or formRender), e.g.

.on('loaded.form_builder', ...)

@kevinchappell
Copy link
Owner

@tacman
that is a good idea

@Devmaleeq
Copy link

Please I have a question. Does JQuery FB allow us add custom event handlers to our form-controls/inputs/select? I'm looking at binding these events on the client facing side.....

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

No branches or pull requests

5 participants