mobx-react-form icon indicating copy to clipboard operation
mobx-react-form copied to clipboard

How to write computed field on nested row?

Open kapilpipaliya opened this issue 7 years ago • 2 comments

How to write computed field on nested row?

kapilpipaliya avatar Dec 15 '17 13:12 kapilpipaliya

can you elaborate it better? thanks

foxhound87 avatar Dec 28 '17 12:12 foxhound87

I have: fields: [ 'position', 'description', 'diamonds', 'diamonds[].position', 'diamonds[].material_id', 'diamonds[].color_id', 'diamonds[].pcs' ] I want to add two calculated functions to diamonds array: this fields should not added to form values. 'diamonds[].pointer' 'diamonds[].weight'

kapilpipaliya avatar Jan 01 '18 07:01 kapilpipaliya

Computed are only available when extending the form/field classes. Cannot be handled using only the form constructor. This is a codesandbox example with nested fields: https://codesandbox.io/s/mobx-react-form--computed-ee5kl1?file=/components/Form.js

foxhound87 avatar Mar 27 '23 13:03 foxhound87

Thanks for your reply.

kapilpipaliya avatar Mar 27 '23 13:03 kapilpipaliya