can i apply datatable Inside datatable?

can i apply datatable Inside datatable?

jatin gajerajatin gajera Posts: 60Questions: 23Answers: 0

can i apply datatable Inside datatable?

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    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

  • jatin gajerajatin gajera Posts: 60Questions: 23Answers: 0

    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??

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    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

  • jatin gajerajatin gajera Posts: 60Questions: 23Answers: 0

    @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.

  • kthorngrenkthorngren Posts: 21,302Questions: 26Answers: 4,947

    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

  • jatin gajerajatin gajera Posts: 60Questions: 23Answers: 0

    yes kevin i will post it..
    kevin i tried it :blush: 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.

  • kthorngrenkthorngren Posts: 21,302Questions: 26Answers: 4,947

    Please post a link to your page or an example so we can help debug.

    Kevin

  • kthorngrenkthorngren Posts: 21,302Questions: 26Answers: 4,947

    I updated my example to work with multiple table ID's.
    http://live.datatables.net/pokogare/1/edit

    Kevin

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    @kthorngren , Kevin, it works for me in Chrome. It does not work in Edge.

  • kthorngrenkthorngren Posts: 21,302Questions: 26Answers: 4,947

    @bindrid that's what you get for using a Microsoft product :wink:

    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

  • bindridbindrid Posts: 730Questions: 0Answers: 119

    @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 :(

  • MSLtdMSLtd Posts: 56Questions: 5Answers: 4

    @bindrid In my experience Firefox has a lot more compatibility than any Micro$oft browser! You'd probably find it much to your relief! :lol: - though honestly I'm surprised you don't have to develop for Safari as well :wink:

  • rangaranga Posts: 31Questions: 12Answers: 2

    Do 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.

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    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

This discussion has been closed.