Jump to content

Date Field inside Repeater field - Missing functionality?


Recommended Posts

I placed a simple "Start Date" - Date Field inside a repeater. I set the options of this date field so that the jQuery UI Datepicker is used when clicking on the calendar icon next to the field. 

When editing my template this calendar icon is missing. So the datepicker never opens. I can however change the functionality of the field so that the datepicker opens when the field is focused. This works fine. When displaying the same field on the template outside of the repeater field though, the calendar icon is displayed correctly and works as expected.

Is this a normal behaviour?

What the date field looks inside a repeater field:

image.png.a8fa3b91cfe733e72179d552f0771e62.png

 

What the date field looks like when added to the template outside of a repeater field:

image.png.caa4f0338a73edd65e4e783ec50035c3.png

Link to comment
Share on other sites

The JS is missing a call to initialise the datepicker when a field is reloaded (e.g. when an ajax-loaded Repeater item is opened). You could open a GitHub issue if you like.

InputfieldDatetime.js needs something like this added:

$(document).on('reloaded', '.InputfieldDatetime', function() {
	var $input = $(this).find('input.InputfieldDatetimeDatepicker:not(.InputfieldDatetimeDatepicker3):not(.initDatepicker)');
	if($input.length) InputfieldDatetimeDatepicker($input);
});

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...