Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Add support of ng-disabled to timepicker #2219

Closed
idrabenia opened this issue May 19, 2014 · 15 comments
Closed

Add support of ng-disabled to timepicker #2219

idrabenia opened this issue May 19, 2014 · 15 comments

Comments

@idrabenia
Copy link

Hi!

Timepicker is great!
But will be very cool if timepicker will have support of ng-disabled directive.

Thanks!

@Siddeshgad
Copy link

Hey

You can use readonly-input="true" for time picker. It will disable timepicker.

@idrabenia
Copy link
Author

Hi!

I know but will be better to support angular standard directives for use it as other usual angular input.

@gediminasgu
Copy link

It's now implemented on PR #2562

@primac-mfahad
Copy link

readonly-input="true" only stops to type inside, but let it be changed on up and down.

@Siddeshgad
Copy link

You can set hour-step and minute-step to zero. It works.

@primac-mfahad
Copy link

Yes it worked! Thanks

@carlospliego
Copy link

So, we need to set three things to correctly disable the input?

@Siddeshgad
Copy link

Yes. If you set readonly-input="true", hour-step and minute-step to zero it will work.

@zakhenry
Copy link

zakhenry commented Mar 5, 2015

While this is a feature that definitely should be implemented, there is a workaround - you can wrap the timepicker in a <fieldset ng-disabled="your.param"></fieldset> to disable all fields in the fieldset.

@theaccordance
Copy link

Having to modify multiple attributes to disable the directive is not ideal, it would be much more preferable to have a single attribute that disables all aspects of this directive from user input.

@amamut
Copy link

amamut commented Jun 11, 2015

Meridian is still editable after disabling everything.

@wesleycho wesleycho added this to the 0.13.x milestone Aug 2, 2015
@deepu105
Copy link

<fieldset ng-disabled="your.param"></fieldset> this is the best workaround disables everything thanks @xiphiaz but yes ng-disabled directly would be better

@deepu105
Copy link

PR seems to have closed with a rollback

@JoeMatulka
Copy link

Careful of the fieldset, it doesn't work in IE...

@AliAdravi
Copy link

In our directive we can watch the ngDisabled value and disable the datepicker
scope.$watch(attr.ngDisabled, function (newVal) {
if(newVal === true)
$(elm).datepicker("disable");
else
$(elm).datepicker("enable");
});
See the complete detail here:
http://www.advancesharp.com/blog/1224/angularjs-jquery-ui-datepicker-for-any-condition

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests