Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a search capability to search messages #3

Open
jonverrier opened this issue May 5, 2024 · 1 comment
Open

Add a search capability to search messages #3

jonverrier opened this issue May 5, 2024 · 1 comment
Labels
Backlog Push to back of queue enhancement New feature or request

Comments

@jonverrier
Copy link
Owner

Likely a panel at the top - do some research on UI patterns.

@jonverrier jonverrier added the enhancement New feature or request label May 5, 2024
@jonverrier jonverrier added the Backlog Push to back of queue label May 16, 2024
@jonverrier
Copy link
Owner Author

https://stackoverflow.com/questions/9127498/how-to-perform-a-real-time-search-and-filter-on-a-html-table

function searchTable(){
var term, table;
// get term to search
term = document.getElementById("myInput").value.toLowerCase();

// get table rows, handle as array.
table = Array.from(document.getElementById("myTable").rows);

// filter non-matching rows; these are set to display='none'
table.filter(function(el){return el.textContent.toLowerCase().indexOf(term) == 
-1}).map(x=> x.style.display = "none");

// filter matching rows; these are set to display =''
table.filter(function(el){return el.textContent.toLowerCase().indexOf(term) > -1}).map(x=> x.style.display = "");

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backlog Push to back of queue enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant