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