Created
July 5, 2018 05:01
-
-
Save rajitha-bandara/b47f70e11d38823263700fc3bb3b6935 to your computer and use it in GitHub Desktop.
This file contains 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
function filter_by_project(){ | |
var input, filter, table, tr, td, i; | |
input = $("#project_filter").val(); | |
filter = input.toUpperCase(); | |
table = document.getElementById("receivings_table"); | |
tr = table.getElementsByTagName("tr"); | |
for (i = 0; i < tr.length; i++) { | |
td = tr[i].getElementsByTagName("td")[3]; | |
if (td) { | |
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) { | |
tr[i].style.display = ""; | |
} else { | |
tr[i].style.display = "none"; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment