Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to clone a datetimepicker input field #87

Open
fjvalles opened this issue Jan 14, 2017 · 0 comments
Open

How to clone a datetimepicker input field #87

fjvalles opened this issue Jan 14, 2017 · 0 comments

Comments

@fjvalles
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant