Parent / child don't selects the parent Entry
Parent / child don't selects the parent Entry
Hi,
I am using the cool „Parent / child editing with Editor” solution (https://datatables.net/blog/2016-03-25).
Unfortunately, when I create a child entry I have to select the parent entry always manually.
I uploaded a test version at https://editor.datatables.net/examples/api/duplicateButton.html. Feel free for any tests.
When you select a parent entry and then click on “New” (for creating a child entry) you have to select the parent entry. At https://datatables.net/blog/2016-03-25 it’s getting selected automatically.
If necessary I can post my php code as well.
Does anybody know the reason?
Thanks, in advance
Patrick
This question has an accepted answers - jump to answer
Answers
Is the problem that the New button is disabled or that when creating a new entry it fails because a parent row is not selected?
Probably will need to see your code or better a test case.
Kevin
Hi,
sorry for the delayed answer. Unfortunately I posted the wring link. The right one is http://wechselstube.host4free.de/start5.php.
It is possible to create an entry and a child entry, but while creating a child entry I must select the parent entry manually.
Do you know what I mean?
Thanks,
Patrick
If I understand correctly you want the ability to create a new child entry and select the corresponding parent entry regardless of the parent row selected. Is this correct?
Kevin
Unfortunetly no. I want it the otherway round so that I don't have to select the parent entry twice (in the table and then in the form).
I guess there is a bug in my version and I can't see the reason for it. Do you know what I mean?
You can try it on http://wechselstube.host4free.de/start5.php to create a child entry. Unfortunetly you have to select the parent entry first in the table and afterthat in the form again.
I think the selected parentId will not deliverd to the form or something like that.
Can you take a look?
Kind regards
Patrick
In the blog example you link to, you select a row from the parent table.
Then, when creating a child table record, the location appears selected in the Editor form. You do not have to select the parent twice.
If that's not happening for you then you have an error or errors in your own
code. Can you not revert to the example code and build up from there?
Great, misunderstood the issue Makes more sense now.
You are getting this console error:
In this part of the config:
I don't see
_stocks.id
in your data. Try changing to.field( 'id' )
.Kevin
Hi Kevin,
this was th right postion and I changed the field value into "_stocks_fees.stock_id" and than it worked pretty good.
Thank you both for your support.
pib