当我更改表单中的字段时,我想将 formotion 表单提交到服务器。有人知道是否有更改回调或类似的东西?
我的表格:
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
最佳答案
一种方法是使用 RMQ观察值。
您可以用它做什么的示例(未经测试):
rmq(UITextView).on(:change) do |sender|
save_something @form.render
end
在行上有一个未记录的(据我所知)on_change
方法,但我不完全确定如何首先获取这些行。
https://github.com/clayallsopp/formotion/search?q=on_change&ref=cmdform
关于ios - Rubymotion:表单更改时自动提交 formotion 表单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19146822/