Issue with not empty target list at initial (PickList)

UI Components for Angular
Post Reply
geotzinos
Posts: 7
Joined: 06 Jul 2017, 15:17

18 Sep 2017, 13:55

Hi,

I found an opened issue from may on stackoverflow, can someone help us ?

https://stackoverflow.com/questions/439 ... g-picklist

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

18 Sep 2017, 15:11

It should work properly with default selected items too. Please create a github issue in the issue tracker. Don't forget to provide the plunker example.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

BootsThunderclap
Posts: 1
Joined: 24 Jul 2017, 19:08

14 Mar 2018, 22:11

I know this is a few months old, but hopefully it helps someone! I ended up doing a filter on the source array like so:

Code: Select all

this.availableRoles = allRoles.filter(userRole => {
	return !this.user.userRoles.some(x => x.id === userRole.id && x.name === userRole.name);
});
I made sure to call this code after I had already subscribed to a few requisite objects (namely, I had to get the list of all roles available in my system, and I had to get the desired user including his/her inherited roles).

Then, in the template side, I bind [source] to availableRoles and [target] to my user object's userRoles property.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests