Skip to content
New issue

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

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

Already on GitHub? # to your account

Open calendar from another element, button, icon #39

Closed
addl opened this issue Aug 28, 2018 · 5 comments
Closed

Open calendar from another element, button, icon #39

addl opened this issue Aug 28, 2018 · 5 comments
Labels
enhancement New feature or request

Comments

@addl
Copy link

addl commented Aug 28, 2018

Allow other elements to show the calendar, for example a icon, button, etc

@addl addl changed the title Open calendar from another component Open calendar from another element, button, icon Aug 28, 2018
@fetrarij fetrarij added the enhancement New feature or request label Aug 31, 2018
@tawsif93
Copy link

@fetrarij Any update about this issue?

fetrarij added a commit that referenced this issue Oct 3, 2018
…s element can not handle the click event located outside calendar

#39
fetrarij added a commit that referenced this issue Oct 3, 2018
…s element can not handle the click event located outside calendar

#39
@fetrarij
Copy link
Owner

fetrarij commented Oct 3, 2018

#47 (comment)

For all element we want to allow an action to the calendar (show, hide,...)

  1. add the class ngx-daterangepicker-action to the element
  2. use ViewChild or ViewChildren to access all method in DaterangepickerDirective or DaterangepickerComponent.

See demo code on: demo/src/app/simple

@fetrarij fetrarij closed this as completed Oct 3, 2018
@addl
Copy link
Author

addl commented Oct 4, 2018

Thanks a lot. Keep the good work up. Best regards

@nuzelac
Copy link

nuzelac commented Nov 9, 2018

@fetrarij do you mind setting the exportAs so we can also reference the directive directly from template?

https://netbasal.com/angular-2-take-advantage-of-the-exportas-property-81374ce24d26

@utkarsh27a
Copy link

#47 (comment)

For all element we want to allow an action to the calendar (show, hide,...)

  1. add the class ngx-daterangepicker-action to the element
  2. use ViewChild or ViewChildren to access all method in DaterangepickerDirective or DaterangepickerComponent.

See demo code on: demo/src/app/simple

I was doing everything which was described in that example, but it was not working.The only difference was I was using a svg-icon instead of button.
I debugged it and solved it, and to save others time, I'm doing this comment.
Sometimes we need to put this.pickerDirective.open(e); in a timeout function.
setTimeout(() => { this.pickerDirective.open(e); })

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants