I have a form in rails with simple form, and I'm using the as: :datetime_picker option to display the datetime selector. I want to clone the input field because it is part of a nested attribute in the form.
I'm having trouble understanding how to do this, because according to the documentation I understand that I have to do the following:
// Documentation says:
Note All functions are accessed via the data attribute e.g. $('#datetimepicker').data("DateTimePicker").FUNCTION()
$('#datetimepicker1').data('DateTimePicker').destroy();
// Clone the input
$('#datetimepicker1').datetimepicker();
The problem is that the .data('DateTimePicker') makes no sense to me because there is no DateTimePicker data attribute.
I would really appreciate some help with this,
Thanks
I have a form in rails with simple form, and I'm using the as: :datetime_picker option to display the datetime selector. I want to clone the input field because it is part of a nested attribute in the form.
I'm having trouble understanding how to do this, because according to the documentation I understand that I have to do the following:
// Documentation says: Note All functions are accessed via the data attribute e.g. $('#datetimepicker').data("DateTimePicker").FUNCTION()
$('#datetimepicker1').data('DateTimePicker').destroy(); // Clone the input $('#datetimepicker1').datetimepicker();
The problem is that the .data('DateTimePicker') makes no sense to me because there is no DateTimePicker data attribute.
I would really appreciate some help with this, Thanks