question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filter with multiple selection mode

See original GitHub issue

Hi, I am using the Filter feature within Multiple Selection. They work fine separately, but there are issue which can’t persist selected item across filtering. for eg, if I select several items, then type a keyword for filter, then select some new items, then clear keyword. What I expected is the method getSelectedPositions() should return exactly index of selected items. Am i wrong in this situation? Could you please guide me how to achieve this ?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
davideascommented, Mar 6, 2017

@IHNEL, what I can suggest is to override FlexibleAdapter method toggleSelection (I guess you call this method when user clicks on ViewHolder), so you can save and remove your own selection as item reference in your own Set (not List), and have a method called getSelectedItems() which returns always the list of the overall selections between the filters. Also you need to override properly the method isSelected() so that it will not check the list of position but the set of items you saved.

I think it should work.

The Adapter is saving the positions of the current list, not the references of the items. I don’t know if it’s better or worst to have item references against positions.

0reactions
IHNELcommented, Mar 7, 2017

thank you @davideas. Seems this is the only way, I will do this

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to select multiple filter criteria in the filter drop-down list ...
Hello, As the title, I have the very long list of filter criteria (in one column only), can anyone please help me how...
Read more >
Filter Modes - Multi-select and other modes - Power Tools
The Filter Menu has several modes to choose from on each group. The default option is 'Single', which allows only one filter in...
Read more >
Using multi-select mode - Cloudera Documentation
Using multi-select mode. In dashboard filters, you can select multiple options in the dropdown menu. This option allows the user to select multiple...
Read more >
Mat Multiple Select With Filter And Groups - StackBlitz
Starter project for Angular apps that exports to the Angular CLI.
Read more >
Using filter multi-select - TechDocs - Broadcom Inc.
The filters panel has normal and multi-select modes. In normal mode, when you select multiple filters, they are joined with an AND operator....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found