mirror of
https://github.com/quasar/Quasar.git
synced 2026-04-25 15:25:59 +03:00
[GH-ISSUE #433] Search The Client ListView #220
Labels
No labels
bug
bug
cant-reproduce
discussion
duplicate
easy
enhancement
help wanted
improvement
invalid
need more info
pull-request
question
wont-add
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Quasar#220
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @LostSoulfly on GitHub (Mar 22, 2016).
Original GitHub issue: https://github.com/quasar/Quasar/issues/433
I'm contemplating implementing this simple feature and was curious as to what the best method would be.
The simplest way I can think of is to create and hide a new ListView on demand when the list is being filtered. Basically: You begin typing on frmMain with the ListView selected and a TextBoxpops up in the corner. A new, previously hidden, ListView appears over the current one with the results filtered by the text in the TextBox. When you erase or change the text, the new ListView updates or hides itself when the TextBox is empty.
I would probably use ListenServer.ConnectedClients and check each one for the search string and add them to the new list.
The other option would be to clear the original list and add the search results and then re-populate it afterwards. This would require code to prevent the list being written to during search, which is not ideal.
Any thoughts or ideas?
@LjungErik commented on GitHub (Mar 22, 2016):
In my personal opinion I would probably go with the later option. The reason for this is that it would possibly allow less duplication of code because the original
ListViewcan be used. Also I don't believe that it will be necessary to use a separate list for the filtered clients. It should be possible to just filter theConnectedClientsdirectly and then add the filtered clients to theListView. 😄This is however just my personal thoughts on the matter.
@LostSoulfly commented on GitHub (Mar 23, 2016):
I see your point. Would I lock the list? What happens when a new client
connects and needs to be added to the list?
@LjungErik commented on GitHub (Mar 23, 2016):
Locking is probably required given that
ConnectedClientsis a shared resource. When it comes to new clients connecting you could simply just check them against the filter before adding them to theListView.Also a little side note, I think you should be able to use
_clientConnectionsinstead of directly usingListenServer.ConnectedClients.@yankejustin commented on GitHub (Mar 24, 2016):
Use a thread-safe List perhaps.
@d3agle commented on GitHub (Jul 29, 2016):
Is this desired? I have a working implementation and example: https://i.gyazo.com/cfb384de0ee7c937e03fd5390d07370b.mp4
@LostSoulfly commented on GitHub (Jul 29, 2016):
Indeed it is!