Primeng: Multiselect Dropdown with Groups

Created on 10 May 2018  路  8Comments  路  Source: primefaces/primeng

howto

I want to achieve multi-select dropdow with groups as shown in the above pic.

new feature

Most helpful comment

All 8 comments

Hi, did you manage to get this done? I'm looking for the exact same thing

Sadly Nope :-( No reply from PrimeNG too.

+1

+1

One workaround would be to add a disabled item, and use it as a group label. Then use CSS to remove the empty checkbox, and use a custom item template in the multiselect component.

CSS Example
li.ui-state-disabled.ui-multiselect-item > div.ui-chkbox { display: none !important; }

Template Example
<p-multiSelect [options]="cars" [(ngModel)]="selectedCars2" [panelStyle]="{minWidth:'12em'}"> <ng-template let-car pTemplate="item"> <img src="assets/showcase/images/demo/car/{{car.label}}.png" style="width:24px;display:inline-block;vertical-align:middle"/> <div style="font-size:14px;float:right;margin-top:4px">{{car.label}}</div> </ng-template> </p-multiSelect>

Duplicate of #2622, except that issue also asks for a checkbox to check / uncheck an entire group (which would be helpful).

I too needed this multiselect with groups. I created a wrapper on top of multiselect. Have a look here.
https://medium.com/@saurabhatgate/grouped-multi-select-with-primeng-113616df9981

Was this page helpful?
0 / 5 - 0 ratings

Related issues

miresk picture miresk  路  3Comments

SchneMa picture SchneMa  路  3Comments

Faigjaz picture Faigjaz  路  3Comments

cyberrranger picture cyberrranger  路  3Comments

philly-vanilly picture philly-vanilly  路  3Comments