primeng icon indicating copy to clipboard operation
primeng copied to clipboard

SelectButton onClick event

Open brian428 opened this issue 9 years ago • 1 comments

I'm submitting a ... (check one with "x")

[ ] bug report => Search github for a similar issue or PR before submitting
[X] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior Currently, SelectButton only dispatches onChange(). If multiple option is enabled, it is difficult to determine which option was actually clicked on. onClick() would allow for this.

brian428 avatar Jul 13 '17 15:07 brian428

Hello, Actually onClick() would be unnecessary for select button. As you can see the code which quoted from PrimeNG-SelectButton page, the options which are clicked on are stored in selectedTypes array.

<h3>Multiple</h3>
<p-selectButton [options]="types" [(ngModel)]="selectedTypes" multiple="multiple"></p-selectButton>
<p>Selected Types: <span *ngFor="let type of selectedTypes">{{type}} </span></p>

However, if you would like to do something with those selected variables, you can add a normal button and use its onClick() event.

SefaMuratcanKatirci avatar Jul 15 '17 14:07 SefaMuratcanKatirci