I want to implement show/hide child rows functionality in multiple tables on same page.

I want to implement show/hide child rows functionality in multiple tables on same page.

epsivennilaepsivennila Posts: 4Questions: 1Answers: 0
edited October 2020 in Free community support

Link to the test case : http://live.datatables.net/wovotobu/9/edit
my first table is not getting initialized. just wrote the simple function to retrieve the row data while clicking on table. First table returning un defined data while second table is working properly. Please provide some help to work on multiple data tables on same page

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 21,173Questions: 26Answers: 4,923

    The first table is table(0) and the second is table(1), like this:
    http://live.datatables.net/wovotobu/10/edit

    Kevin

  • epsivennilaepsivennila Posts: 4Questions: 1Answers: 0
    edited October 2020

    @kthorngren Its working. But can you please clarify me, why its not working when i initialize the table by id #example

    var tables = $('#example').DataTable({
    paging: false,
    "aaSorting": [],
    stateSave: true,
    "stateDuration": -1,
    stateLoadParams: function( settings, data ) {
    delete data.order;
    },
    });

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    Answer ✓

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. 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

  • epsivennilaepsivennila Posts: 4Questions: 1Answers: 0

    can you please look at this test case http://live.datatables.net/wovotobu/10/edit

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    Answer ✓

    You can't use a table id in this context. An id has to be unique on a page.

  • epsivennilaepsivennila Posts: 4Questions: 1Answers: 0

    Thank you all for your help

This discussion has been closed.