-
-
Notifications
You must be signed in to change notification settings - Fork 87
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
library: Add Search entry #343
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool
And also how do I know if I got no matching results from the search so that I can show a status page for it?
Good question. I guess you store a count that is updated on invalidation and filter
example
let results_count = -1;
fuinction filter(row) {
const match = res.test...
if (match) results_count++
return match
}
searchentry.connect("search-changed", () => {
// using -1 and not 0 so you can differentiate between
// no results and not filtered yet
result_counts = -1;
listbox.invalidate_filter();
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job
Closes #338
I'd like to know if I implemented the filtering functionality properly or do I need to change something. And also how do I know if I got no matching results from the search so that I can show a status page for it?