Can you pass the data to another view?
Can you pass the data to another view?
So I've built a datatable which has ordering, searching for our Employee Directory.
We only have just over 300 employees so I bring the complete EmployeeModel from MVC into my view
Now the user selects the drop down over department and picks the Technology department
It filters this data fine down to 15 employees.
What I need now is the ability for the user to click a Button -> Photo Directory
This would take them to a new View with this filtered data in a photo tile format
3 across and 5 down with a Cancel and Print Button on that page
How do I pass this filtered data to this new view?
Is it possible?
Answers
Use
rows().data()
to get the table data. Pass theselector-modifier
of{ search: "applied" }
intorows()
to fetch the filtered data. UsetoArray()
to turn the result set into a Javascript array.Kevin
Thanks, this helped me find the following
var table = $('#myTable').DataTable();
table.rows({ search: 'applied' }).data();
This get's me the data
Is there a way to also get the current filters?
I have 2 search boxes and 3 drop downs
Searches: Name and Title
Drop downs: Divsion, Department, Location
What I would love is something that would return the following
Name: A
Department: Maintenance
Location: Raleigh
You can use
search()
,column().search()
orcolumns().search()
as getters (without search terms) to get the current search terms. Is this what you are looking for?Kevin