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

Already on GitHub? Sign in to your account

Is it possible to trigger an event when clicking on something? #46

Closed
marcgg opened this Issue Nov 4, 2012 · 2 comments

Comments

Projects
None yet
2 participants

marcgg commented Nov 4, 2012

Hi,

Right now the only event I can see is on_submit. Is it possible to do something in this maner but for things such as static form elements?

Let's say I want to have an about static element that opens a modal with some text and maybe a couple of images. While I want the about link to look as it is part of the form, it needs to have a custom behavior attached to it.

Is it something formotion can handle, or is it outside of the scope of this gem?

Thanks!

Owner

clayallsopp commented Nov 5, 2012

Yup, Formotion 1.14 added a generic :button row type.

You can use an on_tap method like so:

row = self.form.sections[0].rows[0]
row.on_tap do |row|
  # do something
end

@clayallsopp clayallsopp closed this Nov 5, 2012

marcgg commented Nov 5, 2012

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment