Working with multiply tables

Working with multiply tables

duselguyduselguy Posts: 24Questions: 3Answers: 0
edited May 2020 in Free community support

Hello,
could you, please, give some hints to get table id (<table id="xxxx" ...) from:
1) DataTables callbacks (rowCallback: function (row, data) {..., etc.)
2) Other events (table.on('select', function (e, dt, type, indexes) { ..., etc.)
Best regards,
LP
P.S. I need the table id only for tracing, not to operation on it.

This question has an accepted answers - jump to answer

Answers

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

    This should help, there are examples for both of those: http://live.datatables.net/sopunepu/1/edit

    Colin

  • duselguyduselguy Posts: 24Questions: 3Answers: 0

    Hello Colin,
    thank you for the quick response. The second case works like a charm.
    The first case logs "undefined". Thinking on it ...
    Best regards,
    LP
    P.S. Separate thanks for the "closest" :-)

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

    I'm not seeing undefined on my test case there. Please can you update my example, or link to your page, so that we can see the problem.

    Colin

  • duselguyduselguy Posts: 24Questions: 3Answers: 0

    "undefined" values out only on table initialization. After redraw (table.scroller.measure()) the correct values out. I don't plan to use DataTables callbacks (sorry that I get around this problem, my code is too raw for now).
    Thanks a lot for the help,
    LP

This discussion has been closed.