Apr 12, 2010, 6:35 AM
[CLOSED] [0.8.2] Date Range - correct month does not open
Hi,
I've been struggling a bit with the date range example based on this:
https://examples1.ext.net/#/Form/Dat...From-To_Range/
How can I get the correct month to show up when I trigger the date picker?
E.g. if I pick a future month on the first field, I want that to be the month that shows up when I trigger the second field. Instead it always shows the current month. This is annoying from a usability perspective because the user has to unnecessarily click forward many months manually to find the first date they can pick.
Example:
<ul>[*]I want to select a start date in 16 June (when today is April).[*]I trigger the end date, and expect the June month to open up showing 16 June as earliest date I can pick.[*]Instead, I see it open in April and have to manually click through to June which is not great from a usability perspective.[/list]The only way I can work around this is to set the start date on the blur of the end date, but this isn't sufficient because I want to allow blank end dates.
I tried to use the BeforeShow listener on the End date but that listener doesn't seem to fire. The Focus listener seems to run too late, and Show fires after the picker has shown, so it is too late. BeforeShow seems ideal, but it doesn't seem to fire? (I tried just a console.log('hello') with Firebug in the BeforeShow listener and it didn't log anything, so I assume it doesn't work at all.
I also looked around in the Ext JS forums and one or two others had a similar problem but there didn't seem to be an easy answer. Some suggested overriding the DateField in some way, but given we have Coolite wrapping all this, I don't know if you have other alternatives that could be used, or your own wrapper? Any ideas?
Thanks!
Anup
(P.S. In your example, I *think* you have the From and To labels the wrong way round!)
I've been struggling a bit with the date range example based on this:
https://examples1.ext.net/#/Form/Dat...From-To_Range/
How can I get the correct month to show up when I trigger the date picker?
E.g. if I pick a future month on the first field, I want that to be the month that shows up when I trigger the second field. Instead it always shows the current month. This is annoying from a usability perspective because the user has to unnecessarily click forward many months manually to find the first date they can pick.
Example:
<ul>[*]I want to select a start date in 16 June (when today is April).[*]I trigger the end date, and expect the June month to open up showing 16 June as earliest date I can pick.[*]Instead, I see it open in April and have to manually click through to June which is not great from a usability perspective.[/list]The only way I can work around this is to set the start date on the blur of the end date, but this isn't sufficient because I want to allow blank end dates.
I tried to use the BeforeShow listener on the End date but that listener doesn't seem to fire. The Focus listener seems to run too late, and Show fires after the picker has shown, so it is too late. BeforeShow seems ideal, but it doesn't seem to fire? (I tried just a console.log('hello') with Firebug in the BeforeShow listener and it didn't log anything, so I assume it doesn't work at all.
I also looked around in the Ext JS forums and one or two others had a similar problem but there didn't seem to be an easy answer. Some suggested overriding the DateField in some way, but given we have Coolite wrapping all this, I don't know if you have other alternatives that could be used, or your own wrapper? Any ideas?
Thanks!
Anup
(P.S. In your example, I *think* you have the From and To labels the wrong way round!)