Datatables editor: editing the related table in many to many

Datatables editor: editing the related table in many to many

raffy4284raffy4284 Posts: 7Questions: 2Answers: 1

So, in your examples with many to many joined tables, I see I'm only limited to a drop down (i.e. I can't change the name of the location etc)
example: https://editor.datatables.net/examples/inline-editing/join.html

I was wondering if it's possible to do this? (I tried doing "->leftJoin("OtherTable", "OtherTableID", '=', "ForeignID") and then referencing each Field items as either "OtherTable.column" or "MainTable.column")
Here's the full syntax for the server side that I tried approaching:

Editor::inst($db,'MainTable')
->field(
Field::inst('MainTable.column1'),
Field::inst('OtherTable.column1')
)
->leftJoin('OtherTable', 'OtherTableID','=','ForeignID')
->process($_POST)
->json()

And when passed on to the client side script, I referenced each item as "MainTable.column" and "OtherTable.column", but I believe I ran into a foreign key constraint error (I don't remember exactly, but I can recreate this)

So my goal is to join both "MainTables" and "OtherTables" and have the power to change some of the fields in "OtherTables" (Not just changing which instance of "OtherTables" is "MainTables" attached to)

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.