can i apply datatable Inside datatable?
can i apply datatable Inside datatable?
jatin gajera
Posts: 60Questions: 23Answers: 0
can i apply datatable Inside datatable?
This discussion has been closed.
Answers
Hi @jatin gajera ,
This was actually answered, with an example, on one of your other threads - see here. Look at the first post from @kthorngren on that thread.
Regards,
Colin
yes @colin i already see this thread..but here issue is.
I am apply datatable inside datable and both table apply select extension when i click 1st child table it works but when i open other child and when i click that child row. that time gives error pop up.
error here:
DataTables warning:table id= table_id1 - Cannot reinitialise DataTable
what shoud i do??
You get that error if you're initialising twice - so make sure the child table doesn't have the same ID, or you could use
destroy
when initialising to ensure it's unique. If still failing, we're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.Cheers,
Colin
@colin i am applying different table id both table not same then after faceing same issue. you told me about @kthorngren example here is his link http://live.datatables.net/lupamuko/1/edit you can see in this example open 1st child and select one row then after open another child and select 2nd child's first row datatable not allow this. one time you can select only one child row. and i need multipal child open and select.
My example uses a static table ID. To open and use more than one row you will need to use a different ID for each child row. Sounds like you did this. Also you will need
destroy: true,
in the child Datatable in case you open the child row more than once.Sounds like what you have should work. Can you post an example so we can help debug?
Kevin
yes kevin i will post it..
kevin i tried it but when i tried destroy: true, only one child row select then after other child row i can't select because table was destroy.
i need multipal child row select.
Please post a link to your page or an example so we can help debug.
Kevin
I updated my example to work with multiple table ID's.
http://live.datatables.net/pokogare/1/edit
Kevin
@kthorngren , Kevin, it works for me in Chrome. It does not work in Edge.
@bindrid that's what you get for using a Microsoft product
I don't have Edge. Not sure why it wouldn't work. If you are not able to select a row maybe the table ID is not valid in Edge. That's where I would start.
Kevin
@kthorngren I think its JSBin, not your code. On the job, my code has to run in IE, Edge and Chrome. I bet its just a matter of time that they tell use to include FireFox
@bindrid In my experience Firefox has a lot more compatibility than any
Micro$oft
browser! You'd probably find it much to your relief! - though honestly I'm surprised you don't have to develop for Safari as wellDo you guys have any example of nested datatables in mvc ? i only found this and its way too old and complicated and im sure now there must be an easy way to do it.
Hi @ranga ,
This is JS, not MVC, but it might be useful. You choose a column from the dropdown, and then when you click on a row, it creates a nested table.
Cheers,
Colin