PrimeNG PickList - How to remove/hide Add remove All buttons

UI Components for Angular
Post Reply
Kishan
Posts: 4
Joined: 29 Aug 2016, 18:33

29 Aug 2016, 18:54

We are using PickList component. We have a business requirement to "Do NOT show Add/Remove All buttons". Looks like show/hide of buttons option is not provided with @Input property at component level and there are no Ids or separate style classes for these buttons.

Can you please consider below options, so that this component will be more dynamic
1. Please provide an input attribute at component level, based on input property show/hide the buttons. This will be more dynamic and will be useful based on the requirement.
2. Or At least provide the Ids or different style classes to these buttons. We can use these Ids/style classes to show/hide these buttons.

Can anyone help on the solution for this requirement.

Kishan
Posts: 4
Joined: 29 Aug 2016, 18:33

02 Sep 2016, 17:04

Found workaround for this.

$(".fa-angle-double-right").parent().remove();
$(".fa-angle-double-left").parent().remove();

fibrenoire
Posts: 14
Joined: 18 Jul 2016, 21:26

15 Sep 2017, 18:35

.ui-picklist button[icon="fa-angle-double-left"] {
display: none !important;
}

.ui-picklist button[icon="fa-angle-double-right"] {
display: none !important;
}

johnny4young
Posts: 1
Joined: 19 Sep 2017, 23:17

19 Sep 2017, 23:46

I suggest the next:

in the template create a reference template like #picklistAction, then in the class set a instance the nativeElement, eg:
let picklist = this.picklistAction.el.nativeElement;

you can get ref of both them

let buttonrightAll = picklist.querySelector(".ui-picklist-buttons button[icon='fa-angle-double-right']") as HTMLElement;
let buttonleftAll = picklist.querySelector(".ui-picklist-buttons button[icon='fa-angle-double-left']") as HTMLElement;


you can do much, like

buttonleftAll.style.display = "none !important";

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests