Ticket #5665 (closed bug: fixed)

Opened 4 years ago

Last modified 18 months ago

Datepicker: Disabled parameter doesn't work

Reported by: fedehf Owned by:
Priority: major Milestone: 1.8.15
Component: ui.datepicker Version: 1.8.1
Keywords: disabled datepicker Cc:
Blocking: Blocked by:

Description

<html>
<head>
<title>Jquery datepicker</title>
<script type="text/javascript" src="file://C://Users//federicof//Work//research//jquery//jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="file://C://Users//federicof//Work//research//jquery//jquery.ui.core.js"></script>
<script type="text/javascript" src="file://C://Users//federicof//Work//research//jquery//jquery.ui.datepicker.js"></script>
<link type="text/css" href="http://jqueryui.com/demos/demos.css" rel="stylesheet" />
<script type="text/javascript">
	$(document).ready(function() {
		$("#datepicker").datepicker( { disabled : true } );
	});
</script>
</head>

<body>
	<input id="datepicker" type="text"/>
</body>

</html>

The datepicker doesn't get disabled.

Change History

comment:1 Changed 4 years ago by kbwood

  • Status changed from new to closed
  • Resolution set to wontfix

There is no such option. Use the disable command instead.

$('#datepicker').datepicker().datepicker('disable');

comment:2 Changed 4 years ago by scott.gonzalez

  • Priority changed from minor to major
  • Status changed from closed to reopened
  • Resolution wontfix deleted
  • Milestone changed from TBD to 1.9

All plugins need to have a disabled option, setting it should have the same effect as calling the enable or disable method.

comment:3 Changed 4 years ago by bencoe

I believe I have a patch for this. this is my first time contributing to jQuery-UI so please be liberal with feedback :)  http://github.com/bcoe/jquery-ui/commit/c87588c6f6f8a9ead4235964c46d89041d874bcd

comment:4 Changed 3 years ago by meh-cfl

It would be nice if at least the documentation was updated as I spent ages debugging through the jQuery UI code after following the documentation at:  http://jqueryui.com/demos/datepicker/.

For what its worth you use 'enable' to re-enable the control.

comment:5 Changed 3 years ago by Corey Frang

  • Status changed from reopened to closed
  • Resolution set to fixed

Merge pull request #322 from kborchers/bug_5665

Datepicker: Added checks for the disabled option. Fixed #5665 - Datepicker: Disabled parameter doesn't work

Changeset: 4bdbab9a671c1eaeaea0a2c179b74cde2f84d75e

comment:6 Changed 3 years ago by Corey Frang

Merge pull request #322 from kborchers/bug_5665

Datepicker: Added checks for the disabled option. Fixed #5665 - Datepicker: Disabled parameter doesn't work(cherry picked from commit 4bdbab9a671c1eaeaea0a2c179b74cde2f84d75e)

Changeset: ab3b78e9eb6d6231e68d29aa3b8b7654d732eb52

comment:7 Changed 3 years ago by rdworth

  • Milestone changed from 1.9 to 1.8.15

comment:8 follow-up: ↓ 9 Changed 18 months ago by mblaney

I've reached this closed ticket after trying:

$( ".selector" ).datepicker( "option", "disabled", true );

from the documentation, and finding it doesn't work. I'm using version 1.9.2, and have reverted to:

$( ".selector" ).datepicker("disable") and $( ".selector" ).datepicker("enable") instead, which work fine.

Is this a regression?

comment:9 in reply to: ↑ 8 ; follow-up: ↓ 10 Changed 18 months ago by tj.vantoll

Replying to mblaney:

I've reached this closed ticket after trying:

$( ".selector" ).datepicker( "option", "disabled", true );

from the documentation, and finding it doesn't work. I'm using version 1.9.2, and have reverted to:

$( ".selector" ).datepicker("disable") and $( ".selector" ).datepicker("enable") instead, which work fine.

Is this a regression?

Can you provide a reduced test case showing the problem. This appears to be working just fine to me  http://jsfiddle.net/tj_vantoll/uTxrX/.

comment:10 in reply to: ↑ 9 Changed 18 months ago by mblaney

Replying to tj.vantoll:

Can you provide a reduced test case showing the problem. This appears to be working just fine to me  http://jsfiddle.net/tj_vantoll/uTxrX/.

Thanks for your example, it shows the problem but only for the specific combination of jQuery and jQuery-UI that I'm using. Try it yourself by switching to jQuery 1.7.2 and jQuery-UI 1.8.18.

I'm stuck with jQuery 1.7.2 because I'm using slick grid, which still uses the deprecated $.browser.

I was using jQuery-UI 1.9.2 which exhibits the same problem as 1.8.18 above, but after upgrading to 1.10.0 the problem is fixed, even with jQuery 1.7.2. Interestingly jQuery-UI 1.9.2 doesn't have this problem when used with newser versions of jQuery.

thanks for your help, Malcolm.

Note: See TracTickets for help on using tickets.