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

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Duketown

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

Post 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
Last edited by Duketown on Mon Dec 17, 2012 6:19 am, edited 1 time in total.
psy
Power Poster
Power Poster
Posts: 463
Joined: Sat Jan 22, 2005 11:19 am

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

Post 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')....
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

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

Post 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)
Duketown

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

Post 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
psy
Power Poster
Power Poster
Posts: 463
Joined: Sat Jan 22, 2005 11:19 am

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

Post by psy »

Excellent! :)
Post Reply

Return to “Developers Discussion”