Created
April 29, 2015 14:29
-
-
Save bytefade/e746b89cca3e2740e51d to your computer and use it in GitHub Desktop.
find table - busca rapida em tabelas de html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( document ).ready(function() { | |
// Handler for .ready() called. | |
$("#textFind").keyup(function() | |
{ | |
$('tbody').css('display', 'block'); | |
$('table.table tbody tr td').removeClass('marcado'); | |
$('table.table tbody tr').removeClass('remover'); | |
stringPesquisa = $("#textFind").val(); | |
if (stringPesquisa == "") {$('tbody').css('display', 'none');}; | |
if (stringPesquisa) { | |
//$('table.listagem tbody tr:contains('+stringPesquisa+')').addClass('voltar').removeClass('remover'); | |
$('table.table tbody tr td:nth-child(1):contains(' + $.trim(stringPesquisa) + ')').addClass('marcado'); | |
$('table.table tbody tr:not(:contains(' + $.trim(stringPesquisa) + '))').addClass('remover'); | |
$.expr[":"].contains = $.expr.createPseudo(function(arg) { | |
return function( elem ) { | |
return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0; | |
}; | |
}); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment