3 Datatables in a page

3 Datatables in a page

antoniocibantoniocib Posts: 277Questions: 62Answers: 1

Hi guys,
I need to add other 2 datatables in one page html, how i do it?

This question has an accepted answers - jump to answer

Answers

  • rf1234rf1234 Posts: 2,946Questions: 87Answers: 416

    You just add them; there is nothing special about this. You can have as many data tables on a page as you like. They may be independent of each other or have a parent - child relationship. No problem.

    Here is more about parent child:
    https://datatables.net/blog/2016-03-25

    What you should also be aware of: "$.fn.dataTable.ext.search.push" will apply to all data tables on the page. You can't limit its scope to just one data table on the respective page.

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
  • antoniocibantoniocib Posts: 277Questions: 62Answers: 1
    edited March 2020

    Let me explain better, I have to create a datatable that contains 3 databases where I can edit the data

  • antoniocibantoniocib Posts: 277Questions: 62Answers: 1

    If this is not possible, is it possible to use only one search bar for all 3 datatables?

  • kthorngrenkthorngren Posts: 21,167Questions: 26Answers: 4,921

    have to create a datatable that contains 3 databases where I can edit the data

    Are you wanting to use the Editor for this? You can use your own server side scripts or scripts supplied by the Editor. The Joins doc explains how the supplied scripts support multiple SQL tables.

    is it possible to use only one search bar for all 3 datatables?

    You could do this. It requires custom coding to search all three tables but is not difficult. You can create your own input and use the search API on all three Datatables.

    Kevin

  • antoniocibantoniocib Posts: 277Questions: 62Answers: 1
    edited March 2020

    @kthorngren can u do for me an example? (of search bar)

  • kthorngrenkthorngren Posts: 21,167Questions: 26Answers: 4,921
    Answer ✓

    can u do for me an example? (of search bar)

    http://live.datatables.net/baqebexi/1/edit

    Kevin

  • antoniocibantoniocib Posts: 277Questions: 62Answers: 1

    Can u explain how to add this at my project?

  • antoniocibantoniocib Posts: 277Questions: 62Answers: 1

    Solved, i understand how to do, ty man u r the best!

This discussion has been closed.