Page 1 of 1

[Solved] Making use of datepicker which is part of jquery

Posted: Sun Dec 16, 2012 9:52 pm
by Duketown
Hi,

I'm working on a module for CMSMS 1.11 environment.
In ..lib/jquery/js/jquery-ui-1.8.21.custom.min.js there is datepicker included. In the back end this file is available via the header tag of the rendered HTML.
One of the input fields in the backend is defined in the templates as follows:

Code: Select all

<div class='pageoverflow'>
	<p class='pagetext'>{$title_start_date}:</p>
	<div class="pageinput datepicker">{$input_start_date}</div>
</div>
However the start date doesn't show me the date picking part if set to focus.
I've tried making datepicker an id in stead of a class. Didn't work.
I've used span around the input field, no result.
I've used replace on the class of the input field (thus removing cms_textfield and changing it into datepicker as part of the class of the input tag). No results.
How to make use of the globally available jquery part in the back end?

Duketown

Re: How to make use of datepicker which is part of jquery se

Posted: Sun Dec 16, 2012 10:03 pm
by psy
The datepicker class is on the div, not the input field. Have you specified in your javascript call that the datepicker is:

Code: Select all

$('.datepicker input')....

Re: How to make use of datepicker which is part of jquery se

Posted: Sun Dec 16, 2012 10:44 pm
by Jos
You might want to take a look at the Custom Global Settings module.

I've put a lot of time and effort into this module to make the jQuery date (and time) picker work. I even tried to let it honour the language and locale settings of the current user 8)

Re: [Solved] Making use of datepicker which is part of jquer

Posted: Mon Dec 17, 2012 6:22 am
by Duketown
@psy: after removing a lot of junk (read test coding), this seems to be the trick
@jos: thanks for the info. That module part is very clarifying for localising.
What I tried to achieve was to have no reference to a jquery source at all in my coding. I've succeeded in that.

Duketown

Re: [Solved] Making use of datepicker which is part of jquer

Posted: Mon Dec 17, 2012 7:36 am
by psy
Excellent! :)