Difference between revisions of "Widget:TableFilter"
From DDO Compendium
(initial) |
(tweak) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly> | |||
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> | |||
<script> | <script> | ||
$(document).ready(function () { | |||
$( "#bodyContent" ).prepend( "<input class=\"form-control\" id=\"filter\" placeholder=\"Type here to filter all tables.\"><hr>" ); | |||
$("#filter").on("keyup", function () { | |||
var value = $(this).val().toLowerCase(); | |||
$(".filterable tbody tr").filter(function () { | |||
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1) | |||
}); | |||
}); | |||
}); | |||
</script> | </script> | ||
</includeonly> |