can datatables child row add another table?
can datatables child row add another table?
fanface
Posts: 11Questions: 2Answers: 0
hi,i have a question about datatables,like the example Child rows,but i need the child row show up another table!The second table like the first also use ajax to load data,now i try the way like example but i can't work,when i click the row,the child row show up a while then close,i google it whole afternoon but nothing found to solve this problem,can anyone have any ideas or did this before?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Here is an example of using ajax loaded child rows:
https://datatables.net/blog/2017-03-31
You can format the output in any way you want.
Not sure if you wanted the child detail row to use Datatables. If so here is an example:
http://live.datatables.net/nabiyibo/1/edit
Kevin
hi kthorngren,i tried your answer to fix my code,but it didn't work,console can show the data by ajax but when i click the row,the child row show up quickly then the child row disappear!
Hard to say what the problem is without seeing your page. Can you post a link to your page or a test case replicating the issue?
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
my code like this live.datatables.net/taniveki/1/edit
,but the child_table id is a unique id,i can't find any datasource so just use the example datasource,and i don't know why i click the row but nothing happen,maybe the child_table id is the problem
do you need a test page? mowao.net/index/commission/balance.html
just click this,this is the problem what i said.
i found the issue just now,is the responsive. can i turn on the responsive to show the child row or not?
thanks,kthorngren!
Not sure what the login info is.
There are a few problems:
1. Your live.datatables.net example has
classname
instead ofclassName
2. HTML id's probably shouldn't have spaces in them like the name column
Updated number 1 and replaced the space in the name with a dash to use for the ID:
http://live.datatables.net/tojokaze/1/edit
Kevin
find the issue,cause i set the attr responsive to true,then the child row can't show up
i need to responsive the mobile page,but if i let the responsive turn true,the child row would not show up,do you have any ideas to fix this issue?