Created
November 30, 2017 11:39
-
-
Save luan0ap/822d93a44ccd5be1bd92d5e52c02e343 to your computer and use it in GitHub Desktop.
Search for itens in a table
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
/*Filtragem do conteúdo*/ | |
/*function filterItemsTable(e, table) { | |
return () => { | |
function tableGetRows(table) { | |
Array.prototype.forEach.call(table.rows, (filter)); | |
} | |
tableGetRows(table) | |
function filter(row) { | |
let cel = row.querySelector('td') | |
row.style.display = cel.textContent[0].indexOf(e.value.toLowerCase()[0] || "") ? 'none' : 'block' | |
} | |
} | |
} | |
const $inputSearchTable = document.querySelector('[data-table="search"]') | |
$inputSearchTable.addEventListener('input', filterItemsTable($inputSearchTable, $tablePrice))*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment