summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b851c15)
Based on an example from datatables.net
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
$(document).ready(function() {
$(document).ready(function() {
- $("#machines").DataTable({
+ $('#machines thead tr').clone(true).appendTo('#machines thead');
+ $('#machines thead tr:eq(1) th').each(function (i) {
+ var title = $(this).text();
+ $(this).html('<input type="text" placeholder="Search \''+title.toLowerCase()+'\'" />');
+ $('input', this).on( 'keyup change', function () {
+ if (table.column(i).search() !== this.value) {
+ table.column(i).search(this.value).draw();
+ }
+ });
+ } );
+
+ var table = $("#machines").DataTable({
orderCellsTop: true,
pageLength: 25,
lengthMenu: [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]]
orderCellsTop: true,
pageLength: 25,
lengthMenu: [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]]