我将ProMotion与PM :: FormotionScreen屏幕一起使用。
如何在ProMotion中使用Formotion中的行.on_delete callback
我有这个table_data方法
def table_data
{
sections: [{
rows: [
{
title: "URL",
key: :url,
placeholder: "http://myapp/dj_mon/",
action: :delete_account,
deletable: true,
type: :string,
auto_correction: :no,
auto_capitalization: :none
}
]
}]
}
end
答案 0 :(得分:2)
您必须使用DSL:
,而不是使用哈希来初始化Formotion表单form = Formotion::Form.new
form.build_section do |section|
section.build_row do |row|
row.title = 'URL'
row.key = :url
row.placeholder = "http://myapp/dj_mon/"
row.type = :string
row.auto_correction = :no
row.auto_capitalization = :none
row.deletable = true
row.on_tap do |row|
p "I'm tapped!"
end
row.on_delete do |row|
p "I'm called before the delete animation"
end
end
end