[GH-ISSUE #433] Search The Client ListView #220

Open
opened 2026-02-27 15:49:23 +03:00 by kerem · 6 comments
Owner

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?

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?
Author
Owner

@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 ListView can 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 the ConnectedClients directly and then add the filtered clients to the ListView. 😄

This is however just my personal thoughts on the matter.

<!-- gh-comment-id:200041966 --> @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 `ListView` can 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 the `ConnectedClients` directly and then add the filtered clients to the `ListView`. :smile: This is however just my personal thoughts on the matter.
Author
Owner

@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?

<!-- gh-comment-id:200111530 --> @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?
Author
Owner

@LjungErik commented on GitHub (Mar 23, 2016):

Locking is probably required given that ConnectedClients is a shared resource. When it comes to new clients connecting you could simply just check them against the filter before adding them to the ListView.

Also a little side note, I think you should be able to use _clientConnections instead of directly using ListenServer.ConnectedClients.

<!-- gh-comment-id:200226742 --> @LjungErik commented on GitHub (Mar 23, 2016): Locking is probably required given that `ConnectedClients` is a shared resource. When it comes to new clients connecting you could simply just check them against the filter before adding them to the `ListView`. Also a little side note, I think you should be able to use `_clientConnections` instead of directly using `ListenServer.ConnectedClients`.
Author
Owner

@yankejustin commented on GitHub (Mar 24, 2016):

Use a thread-safe List perhaps.

<!-- gh-comment-id:200706842 --> @yankejustin commented on GitHub (Mar 24, 2016): Use a thread-safe List perhaps.
Author
Owner

@d3agle commented on GitHub (Jul 29, 2016):

Is this desired? I have a working implementation and example: https://i.gyazo.com/cfb384de0ee7c937e03fd5390d07370b.mp4

<!-- gh-comment-id:236265251 --> @d3agle commented on GitHub (Jul 29, 2016): Is this desired? I have a working implementation and example: https://i.gyazo.com/cfb384de0ee7c937e03fd5390d07370b.mp4
Author
Owner

@LostSoulfly commented on GitHub (Jul 29, 2016):

Indeed it is!

<!-- gh-comment-id:236267519 --> @LostSoulfly commented on GitHub (Jul 29, 2016): Indeed it is!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Quasar#220
No description provided.