Giter Club home page Giter Club logo

Comments (11)

g00fy- avatar g00fy- commented on July 27, 2024

could you share the code you are using?

from angular-datepicker.

figalex avatar figalex commented on July 27, 2024

I implemented the datepicker just as you show on the demo, using Angular 1.1.5 and jQuery, everything works as its supposed to but i want to have the datepicker inside a popover form, right now the datepicker only disappears when the input that displays the datepicker triggers the blur event, so if a have the datepicker inside a popover the form width is to small and the user could click outside of the popover and dismiss the whole form instead of just dismiss the datepicker. What i want to do is dismiss only the datepicker when user already has selected a date without having to trigger the inputs blur event.

from angular-datepicker.

g00fy- avatar g00fy- commented on July 27, 2024

in the example here https://github.com/g00fy-/angular-datepicker/blob/dev/app/index.html I am using angular-ui for convenience.

you are still able to use ng-click and other events, so you may want to do $event.preventDefault() if you wish.

<div class="dropdown-menu" ng-click="$event.preventDefault();$event.stopPropagation()">
                <div date-picker="date"></div>
            </div>
``


I would be able to help to help you more if you could provide some code example.

from angular-datepicker.

figalex avatar figalex commented on July 27, 2024

Check this plunker http://plnkr.co/edit/6HBUaKWwTY8aYXYAIYto?p=preview

Take a look at the first input, i need an input just like that one, but as you can see when you select a date the calendar it still open, what i want is to remove the calendar when the user already select a date and if the user clicks again the input i want to display the calendar again.

The ng-click event of every td element of the calendar is already in use by the functions that you created, i tried removing the calendar inside those functions by triggering the blur event of the input but that didnt work for me.

from angular-datepicker.

srigi avatar srigi commented on July 27, 2024

+1 on this. I too would be thankful if widget closes after clicking on date in calendar.

from angular-datepicker.

g00fy- avatar g00fy- commented on July 27, 2024

Currently this can be achieved by having onchange that would trigger blur on the input.
Need to decide whether I should add another attribute like dismiss="true" or find a different solution.
Any suggestions?

from angular-datepicker.

srigi avatar srigi commented on July 27, 2024

Once I saw configuration of a Directive via value service:

angular.module('foo', [])

.value('config', { dismiss:true })

.directive('dateTime', function(config){
  var options = _.extend(defaults, config)
  ...
})

Maybe there is a way how to use this config object optionaly. If user doesn't provide one, only defaults are used.

from angular-datepicker.

jbourassa avatar jbourassa commented on July 27, 2024

I like @srigi's approach. Definitely would like to have some sort of mechanism to dismiss the date picker too.

from angular-datepicker.

g00fy- avatar g00fy- commented on July 27, 2024

1.0.0 has config with dismiss, and accepts dismiss="true" param

from angular-datepicker.

astik avatar astik commented on July 27, 2024

I like the way you can configure the dismiss param.

It seems there is a probleme still with this feature.
Once you configure dismiss to true, each time you select a element (year, month, day, ...) the calendar close.
It should close only at the end of the workflow :

  • date picker : close after day selection
  • date-time picker : close after minute

from angular-datepicker.

g00fy- avatar g00fy- commented on July 27, 2024

AFAIR it closes at the end of workflow, which is the last view avaiable.
Will investigate!

2013/10/15 Romain Gonord [email protected]

I like the way you can configure the dismiss param.

It seems there is a probleme still with this feature.
Once you configure dismiss to true, each time you select a element (year,
month, day, ...) the calendar close.
It should close only at the end of the workflow :

  • date picker = close after day selection
  • date-time picker : close after minute


Reply to this email directly or view it on GitHubhttps://github.com/g00fy-/angular-datepicker/issues/6#issuecomment-26317501
.

Pozdrawiam

from angular-datepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.