Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SelectButton onClick event #3387

Closed
brian428 opened this issue Jul 13, 2017 · 1 comment
Closed

SelectButton onClick event #3387

brian428 opened this issue Jul 13, 2017 · 1 comment
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@brian428
Copy link
Contributor

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.

@SefaMuratcanKatirci
Copy link

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.

@cagataycivici cagataycivici self-assigned this Aug 23, 2017
@cagataycivici cagataycivici added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Aug 23, 2017
@cagataycivici cagataycivici added this to the 4.2 milestone Aug 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

3 participants