Can I use the data found by the global search
Can I use the data found by the global search
TomBajzek
Posts: 164Questions: 37Answers: 1
Is there a way for my program to access the results of a global search (i.e., using the search box)? What I want to do is to display images whose pointers are contained in the records of the result set of a search that the user does by entering something into the on-page global search box. I've found a lot of information about DataTables search but I don't think I've found how to do that.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Sounds like you want to use
rows().data()
with aselector-modifier
of{search:'applied'}
. You can usepluck()
to get the particular column andtoArray()
if you want an array of data instead of an array of Datatables API objects.for example:
table.rows({search:'applied'}).data().pluck('images').toArray();
Assumes you have a column named "images".
Kevin