PDA

View Full Version : Some things to do on a Datepicker



Walter_White
5 Jul 2011, 5:19 AM
Hello,

I want to do some things with a DatePicker but, even after doing some researchs, I'm not able to.
I want to disable the possibility for the user to change month or year (no scrolling, no ctrl + arrow, no arrow on the left and the right and no clicking on the month).
And I want to disable all the keyboard shortcuts.

Is there any way to do that without overriding Datepicker with a new class?

Thanks for helping

skirtle
5 Jul 2011, 4:25 PM
Disabling all keyboard shortcuts is potentially a very bad idea. It is not safe to assume that everyone uses a mouse.

I suspect you may be better off just writing your own extension of BoxComponent, borrowing bits of the onRender() method from DatePicker. Even if this approach doesn't work out it may give you insight into a better approach.

Walter_White
8 Jul 2011, 1:00 AM
What I'm actually using Datepicker for is displaying availibility for a hostel depending on days.
There are 3 datepicker side by side, and the user is not supposed to be able to change month of 1 calendar but he have to click on a button I made and that change the months of the 3 calendars at the same time.
That's why I don't want they can use keyboard shortcuts ;)