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

Multiple select in filter-control #3298

Open
Valery1991 opened this issue Aug 2, 2017 · 47 comments
Open

Multiple select in filter-control #3298

Valery1991 opened this issue Aug 2, 2017 · 47 comments
Assignees
Labels
feature Issues asking for a new feature to be added, or an existing one to be extended or modified. filter-control Issues for the filter-control extension.

Comments

@Valery1991
Copy link
Contributor

Hello,

I was wondering if there is a way to get multiple select in filter-control to work? For example, selecting two (or more) filters in a single dropdown.

Thanks & kind regards.

@wenzhixin wenzhixin added feature Issues asking for a new feature to be added, or an existing one to be extended or modified. filter-control Issues for the filter-control extension. labels Dec 24, 2017
@wenzhixin wenzhixin reopened this Apr 17, 2019
@jamesRUS52
Copy link

Hello
When will release v2.0.0 ?
Do you have any workaround, to use any custom control? Is it posible use custom controls like select2, bootstrap-select or bootstrap-multiselect?

@wenzhixin
Copy link
Owner

@g3rd0
Copy link
Contributor

g3rd0 commented Apr 7, 2020

Consider adding support for https://github.com/wenzhixin/multiple-select plugin.

https://live.bootstrap-table.com/code/sebastiangehrt/2412

https://live.bootstrap-table.com/code/sebastiangehrt/2413 is the correct use case for multi select for e.g. a categorie

@rayoray
Copy link

rayoray commented Apr 9, 2020

Consider adding support for https://github.com/wenzhixin/multiple-select plugin.

https://live.bootstrap-table.com/code/sebastiangehrt/2412

@wenzhixin multiple-select.js plugin does not seem to work together with bootstrap-table-filter-control.js see https://codepen.io/rayzoray/pen/pojooVo

@wenzhixin
Copy link
Owner

@rayoray
Copy link

rayoray commented Apr 10, 2020

@wenzhixin no not exactly: data-field="city" must be class="multiple-select".

image

@wenzhixin
Copy link
Owner

You can use the bootstrap theme: <link href="https://unpkg.com/multiple-select@1.5.2/dist/themes/bootstrap.min.css" rel="stylesheet">.

http://multiple-select.wenzhixin.net.cn/examples#themes.html

@rayoray
Copy link

rayoray commented Apr 10, 2020

@wenzhixin theme helps, but selecting checkbox options does not filter table; see example pen: https://codepen.io/rayzoray/pen/jObOdvz

@wenzhixin
Copy link
Owner

Yes, multiple select filtering is not yet supported, so mark it as a feature.

@rayoray
Copy link

rayoray commented Apr 10, 2020

@wenzhixin do you have a temporary solution or workaround that you can share for this feature? as this issue has been identified in 2017?

@albfan
Copy link
Contributor

albfan commented Jun 18, 2020

Just to update the case:

multi-select-filter

https://live.bootstrap-table.com/code/albfan/3509

I think some work needs to be done on filtering multiple select (like do a OR instead of AND filter), but that's expected.

@wenzhixin so just using the dist/ directory instead of cdn is enough right?

@UtechtDustin
Copy link
Collaborator

@albfan
As you can see the issue is still open, which means the table currently dont support multiselects.

@Crusader2010
Copy link

Hi guys. Any news on this?

@djhvscf
Copy link
Collaborator

djhvscf commented Oct 5, 2020

Still working on it. This requires the extension to be rewritten.

@mayo589
Copy link

mayo589 commented Dec 30, 2020

Hi :) any rough guess, when this feature will be added?

@vlatro
Copy link

vlatro commented Jan 14, 2021

Hi guys, this would really be a nice functionality.
Is there any workaround for now?

@ashmosis
Copy link

@djhvscf any update on when this feature may be available? Let me know if I can be of any assistance.

@djhvscf
Copy link
Collaborator

djhvscf commented Feb 7, 2021

hi, I'm working on recreate the extension. This in order to have a better extension, robust and stable. See the progress here: https://github.com/wenzhixin/bootstrap-table/tree/feature/multiselect-filtercontrol

@albfan
Copy link
Contributor

albfan commented Feb 7, 2021

@djhvscf Any running example. I try modifying my old one with your branch, but nothing seems to work

https://live.bootstrap-table.com/code/albfan/6507

@djhvscf
Copy link
Collaborator

djhvscf commented Feb 8, 2021

See this PR #5583

@albfan
Copy link
Contributor

albfan commented Mar 30, 2021

I tried to follow PR but can see how to enable multiselect. I expected something like data-filter-control="checkbox"

Is there anything we can check using that PR @djhvscf?

@UtechtDustin
Copy link
Collaborator

@albfan
The PR is work in progress, so you have to wait until @djhvscf have done (re)implementing the filter control extension.
If this is done @djhvscf will document it :-)

@albfan
Copy link
Contributor

albfan commented Mar 31, 2021

@UtechtDustin of course.

In the mean time I just update the example to use multiple-select.

https://live.bootstrap-table.com/code/albfan/7140

Captura de pantalla de 2021-03-31 10-09-03

NOTE: at onCreatedControls options are still not loaded
NOTE2: this multiple select do not filter

@albfan
Copy link
Contributor

albfan commented Apr 1, 2021

Example reworked to use multiselect with filterBy:

It honor cleanSearch:

https://live.bootstrap-table.com/code/albfan/7162

multiselect-bootstrap-table.mp4

@djhvscf
Copy link
Collaborator

djhvscf commented Apr 2, 2021

We're going to implement multiselect using this library http://multiple-select.wenzhixin.net.cn/ which is part of @wenzhixin work!

@djhvscf djhvscf mentioned this issue Apr 18, 2021
36 tasks
@djhvscf djhvscf added the has PR Issues that has been fixed with a PR. label Apr 18, 2021
@albfan
Copy link
Contributor

albfan commented May 14, 2021

@djhvscf there's a mistake in docs, it is not data-filter-multiple-select but data-filter-control-multiple-select.

After fix, multiselect is working as expected.

Will create a PR targetting your PR to fix that part. Will do the same for data-filter-multiple-select-options

@AdeSupriyadi
Copy link

@albfan
example above https://live.bootstrap-table.com/code/albfan/7162
the result not same, filter-control appeared just the last column, and not multi-select
image

@djhvscf
Copy link
Collaborator

djhvscf commented Nov 23, 2021

This feature is removed from the current scope of #5583

@UtechtDustin UtechtDustin removed the has PR Issues that has been fixed with a PR. label Nov 23, 2021
@gb-noyb
Copy link

gb-noyb commented May 31, 2022

Hi all, I am looking for exactly this feature; using the Multiple Select widget in a column filter would be perfect.

@djhvscf (or others!): Given that you tried this but then removed it from the scope of #5583, might you have either warnings or tips on how to implement this? Perhaps you have any (incomplete) code/branch that I could try to continue with, instead of starting from scratch?

@djhvscf
Copy link
Collaborator

djhvscf commented Aug 2, 2022

@gb-noyb we need to start from scratch since this is a major feature for this extension. But since the performance is the priority right now, we don't have plans to implement this feature in the near future

@albfan
Copy link
Contributor

albfan commented Aug 28, 2022

I reworked the live example to use @djhvscf and my improvements (based on 1.18.3 version):

https://github.com/albfan/bootstrap-table/tree/feature/multiselect-filtercontrol

See this only works in bootstrap 4:

https://live.bootstrap-table.com/code/albfan/12640

Captura desde 2022-08-28 14-53-48

@wenzhixin @djhvscf I can work on this if we describe the problems detected (even if that's from scratch)

@djhvscf
Copy link
Collaborator

djhvscf commented Aug 29, 2022

@albfan let's work on that. What kind of details do you need?

@albfan
Copy link
Contributor

albfan commented Aug 30, 2022

cool @djhvscf.

My understanding is from:

This feature is removed from the current scope of #5583

we need to start from scratch since this is a major feature for this extension. But since the performance is the priority right now, we don't have plans to implement this feature in the near future

Some major problems where detected and the feature was rejected.

  • First, let's define a branch where we can work on.

I have this https://github.com/albfan/bootstrap-table/tree/feature/multiselect-filtercontrol, but something on upstream would be better. Not sure if it is ok to have another feature branch (looks bootstrap table always work on develop branch until merge to master and tag)

  • Next let's define a live example where people can show flaws or corner cases. I reread docs and came out with:

https://live.bootstrap-table.com/code/albfan/12674

which is super clean and works with multiple, non multiple selects, inputs. It uses data-filter-control-multiple-select

Detected problems:

  • I can see there's a problem with dropdown on multiple select as it renders inside the table container (see single select is not)

image

  • I tried to define height but that brings more problems (no dropdown is render for multiple select:

https://live.bootstrap-table.com/code/albfan/12676

If @wenzhixin or you @djhvscf are aware of any other problems, or performance penalties let's summarize here. I suppose this could be a solution for many people if we resolve those two I found.

NOTE: Rebase this work is fine for me, but if codebase changed a lot maybe we can start small and fix this working branch

@dharen008
Copy link

dharen008 commented Sep 6, 2022

Hi Guys,

I did it in a different way using filterby and adding a custom button.

please check this out
https://live.bootstrap-table.com/code/dharen008/12730

Let me know if you encounter issues

@CosmoFox
Copy link

Hello everyone!
Will be that future comeback? It`s superactual!

@nickjrotundo
Copy link

nickjrotundo commented Jun 7, 2024

I'm not entirely sure what updates seem to have broken the previously-submitted workarounds, but, here's one I did today. It could use a little cleaning up (like the placeholder), but the idea is there.

https://live.bootstrap-table.com/code/nickjrotundo/17769 Edit: typo and small cleanup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Issues asking for a new feature to be added, or an existing one to be extended or modified. filter-control Issues for the filter-control extension.
Projects
None yet
Development

No branches or pull requests