The library pdfmake is currently not being used by any of the datatables (it's used via datatables-buttons), so I commented it out since it's one of the largest libraries we load. I also bumped the button dependencies up. We were also missing a bootstrap js/style for the buttons.
Before:
After:
Use datatables javascript binding in searchByUser
Bound the data directly to the datatable call. We don't need to manually iterate over the results and print out table rows and columns which is extremely error prone for new tables. We can then use some built in options to give headers, widths, and custom rendering. The timestamp was tidied up with moment.js.
✔️ Reviewable commit-by-commit
This PR has two optimizations to searchByUser.php
The library pdfmake is currently not being used by any of the datatables (it's used via datatables-buttons), so I commented it out since it's one of the largest libraries we load. I also bumped the button dependencies up. We were also missing a bootstrap js/style for the buttons.
Before:
After:
Bound the data directly to the datatable call. We don't need to manually iterate over the results and print out table rows and columns which is extremely error prone for new tables. We can then use some built in options to give headers, widths, and custom rendering. The timestamp was tidied up with
moment.js
.