How to get value entered in search box In Datatables

前端 未结 5 1816
[愿得一人]
[愿得一人] 2020-12-30 23:14

How to get value entered in search box In Datatables. Is there a way to get value entered in search box in Data Tables?

5条回答
  •  说谎
    说谎 (楼主)
    2020-12-30 23:52

    Yes, there is. You call the search method without an argument to get the search term

    var query = dataTable.search()

    https://datatables.net/reference/api/search()

    Get the currently applied global search. If there is more than one table in the API's context, the search term of the first table will be returned. Use table() if you require the search term of a different table in the API's context.

提交回复
热议问题