Child row data from another Mysql Table
Child row data from another Mysql Table
Gerald.Rager
Posts: 19Questions: 3Answers: 0
in Editor
Hi,
i want to create a table with child row for each main row!
example i have 2 Tables First: Table Orders Second: Orderitems
now i want that the main Table Show all Orders
first th(td) of each row has a detail-control button if it is clicked the child-rows for this main-row must appear with data from the orderitems Table
but each row must editable => main-row and child-row
I hope you understand me
Thanks a lot
This question has accepted answers - jump to:
This discussion has been closed.
Answers
So you want child tables in the rows of the parent table?
Have you used this example as a basis for creating the structure you want? Have you got it showing child tables (you need to modify the code in the table to have it do that)?
When you have done that, it is simply a case of applying Editor to the child table in order to make it editable like any other DataTable.
Allan
Okay Thank you i will try it
Hallo Allan so the child-row work like the example you post me
now i have do get the data for the child!!!
sorry i forgot i use the php framwork to geht my data from mysql
i want to use the ID from the Main-Row to make a query to get data from another table
ps: the child kan have multiple rows
Thank you
Use the
row().data()
method to get data from the host row, just like what is done in the example.Allan
hey Gerald, if you were able to get it work, do you have some working example which you can share please? I am trying to do the same, childrow with data from another mysql table, I am able to create childrow and format it, but I need to get ID from the parent row (which is not shown, but it is in json) and according it pass it as where to another server side request and parse json result to child
Hey sure i can,
I did it with a workaround i load a datatable when the detail control is clicked
First here is the base table init
now the event listiner for the detail control
});
i hope that help you