Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

DateField showcalendar in SS3


Go to End


2 Posts   1045 Views

Avatar
BlueO

Community Member, 52 Posts

16 May 2012 at 4:10pm

Not sure if this is the right place to be asking this but I've run into an issue on our SS3 beta two test site with DateField.

In 2.4 I can do the following to get a jquery UI popup for my datefield:

$datefield = new DateField('FeatureEndDate', "Feature ends");
$datefield->setConfig('showcalendar',true);
$fields->push($datefield );

then in the template
$dataFieldByName(FeatureEndDate).FieldHolder

It seems all the requisite js + css is getting loaded with DateField.js, jquery-ui.js, jquery.js, jquery-ui.css etc all being there. If I copy DateField.js and execute it in chrome's console I get the following error:

Uncaught TypeError: Object [object Object] has no method 'datepicker'
$.fn.extend.ssDatepicker
jQuery.extend.eachjquery.js:660
jQuery.fn.jQuery.eachjquery.js:271
$.fn.extend.ssDatepicker
(anonymous function)
jQuery.event.dispatchjquery.js:3332
jQuery.event.add.elemData.handle.eventHandle

But other than that I'm not getting other errors on load - can someone help me to debug this a bit further?

cheers

bernard

Avatar
BlueO

Community Member, 52 Posts

21 May 2012 at 5:41pm

I seem to have sorted this - it appears to have been a requirements order problem with jquery being included too late perhaps - its hard to tell as the include order is tricky to deal with...