Vue3 //Script setup// Search in anInput in the navbar and connect it to Datatable in component

Vue3 //Script setup// Search in anInput in the navbar and connect it to Datatable in component

sylvainBsylvainB Posts: 1Questions: 1Answers: 0

Link to test case:
Here is the link to the repository.
https://gitlab.com/tsurubaso-project/vuecovid
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
I have App.vue and a component that content the table, In App.vue a navbar with an input. I would like to connect the input with the search() of the datatable.

Answers

  • allanallan Posts: 61,451Questions: 1Answers: 10,055 Site admin

    You need to use the DataTables API to be able to do that. In the Vue component you can get a reference to the DataTables API through a dt reference - see this section of the manual.

    This example shows the DataTables API being used in Vue. Note that the key part (or one of them anyway) is the ref="table" on the DataTable component tag.

    Allan

Sign In or Register to comment.