primeng
primeng copied to clipboard
SelectButton onClick event
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.
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.