Attaching eonasdan-datetimepicker to dynamically created element returns “relative positioned container” error

匆匆过客 提交于 2019-12-11 12:55:46

问题


I have the following input, which I'm attaching datetimepicker to on pageload:

This works as expected.

When the user clicks a button, I duplicate this input to allow for multiple dates.

Clone code:

The cloning works as expected, but clicking the date input triggers this error:

Uncaught Error: datetimepicker component should be placed within a relative positioned container

.input-group already has "position: relative;" set in a separate CSS file. I tried adding this as an inline style, but id didn't make a difference.

Any ideas? Thanks in advance!


回答1:


Solved! Swapped the order of my .datetimepicker and insertAfter functions. Was trying to add a datetimepicker to an input that didn't yet exist.



来源:https://stackoverflow.com/questions/35204626/attaching-eonasdan-datetimepicker-to-dynamically-created-element-returns-relati

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!