optimistex / ngx-select-ex

Angular based replacement for select boxes
https://optimistex.github.io/ngx-select-ex/
MIT License
109 stars 42 forks source link

doRemove #164

Closed elham-rababah closed 5 years ago

elham-rababah commented 5 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Please, make an example there https://stackblitz.com/ to reproduce the bug and share a link to the example.

Expected behavior A clear and concise description of what you expected to happen.

elham-rababah commented 5 years ago

Sorry for the short description in the first one. calling doRemove function not working form the ts. for example on the ts I put something like this if (this.resetSelect) { this.doBlur(); this.doRemove(1); }} its call the event and print to the console but the vallue still apper on the view in the other hand when u use the clear button every thing work smothly

optimistex commented 5 years ago

@elham-rababah Please, make an example there https://stackblitz.com/ to reproduce the bug and share a link to the example.

elham-rababah commented 5 years ago

@optimistex thanks for fast response I found my problem, Already I was used the wrong function. I found that I should use optionRemove() function

The solution was something like this @ViewChild('localRef') localRef: NgxSelectComponent; private loaclSelectedOption;

if (this.resetSelect) { var event = new MouseEvent('click'); this.localRef.optionRemove(this.loaclSelectedOption, event); }