Skip to content

Instantly share code, notes, and snippets.

@luan0ap
Created November 30, 2017 11:39
Show Gist options
  • Save luan0ap/822d93a44ccd5be1bd92d5e52c02e343 to your computer and use it in GitHub Desktop.
Save luan0ap/822d93a44ccd5be1bd92d5e52c02e343 to your computer and use it in GitHub Desktop.
Search for itens in a table
/*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