clayallsopp/formotion — pull request #138 by rheoli (2013-08-09 14:37:48+00:00)
Title: Enable template_row to use external screens on_tap

The on_tap and on_delete methods on a template_row will set this blocks to the template children too.
It is then possible to add/edit/remove a more complex item in a new window.

```ruby
data = {
sections: [{
title: "Shop",
rows: [{
title: "Name",
key: :name,
type: :string,
value: "MyShop"
}]
},{
title: "Buyed Items",
rows: [{
title: "Add Item",
key: :items,
type: :template,
value: [Item.new("Item1"), Item.new("Item2")],
template: {
title: "",
type: :object,
editable: false,
placeholder: 'Enter here',
indented: true,
deletable: true
}
}]
}]
}
data = Formotion::Form.new(data)
row = data.row(:items)
row.on_tap do |row|
obj = row.value.is_a?(Item) ? row.value : nil
# use ProMotion to open/edit the Item object
open ItemScreen.new(item: obj, item_editable: obj ? false : true, nav_bar: true), modal: true
end
```

Example see button "Shop" in https://github.com/rheoli/formotion-example