I would like to submit the formotion form to a server when I changed a field in the form. Somebody knows if thereis a change callback or something like that?
My form:
class SettingsScreen < PM::FormotionScreen
title "Settings"
tab_bar_item title: "Settings", icon: 'settings'
def table_data
{
sections: [
{
title: "Settings",
rows: [
{
title: "Start Date",
key: :start_date,
type: :date,
format: :medium
}, {
title: "End Date",
key: :end_date,
type: :date,
format: :medium
}
]
}
]
}
end
def on_load
self.form.on_submit do |form|
p "submitting!"
end
end
end
One way would be to use RMQ to watch the values.
An example (untested) of what you could do with it:
There's an undocumented (as far as I know)
on_changemethod on rows, but I'm not totally sure how to get the rows in the first place.https://github.com/clayallsopp/formotion/search?q=on_change&ref=cmdform