Editor: Is there a way to send additional data when creating a record?

Editor: Is there a way to send additional data when creating a record?

MadwikMadwik Posts: 4Questions: 2Answers: 0

I have a very simple table for company addresses (id, company_id, address). The DataTable shows "Company Name, Address". When I create a new record, I need include the company_id so that the address is added to the correct company.

Is there an easy way to append this to the form data that is submitted for a Create action?

Alternatively, I thought about to a doing something with postCreate() to update the newly created record, but this seems overly complicated.

Any ideas/assistance is greatly appreciated.

Thank you!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,532Questions: 1Answers: 10,475 Site admin
    Answer ✓

    Is there an easy way to append this to the form data that is submitted for a Create action?

    Absolutely, you can either use a hidden field type, or use ajax.data to add additional data to that which Editor sends.

    Regards,
    Allan

  • MadwikMadwik Posts: 4Questions: 2Answers: 0

    Excellent! I remembered it having something like ajax.data from a couple months ago, but I couldn't find it this morning. I really like the hidden field type.

    Thanks again for a great tool!

This discussion has been closed.