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

DateTimePicker as dynamically created controls. #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions bootstrap3_datetime/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,22 @@ def conv_datetime_format_js2py(cls, format):
var callback = function() {
$(function(){$("#%(picker_id)s:has(input:not([readonly],[disabled]))").datetimepicker(%(options)s);});
};
if(window.addEventListener)
// if window object id loaded already, call directly callback function
if (-1 != $.inArray(
document.readyState,
["loaded", "interactive", "complete"]
)
) {
callback();
}
else if (window.addEventListener) {
window.addEventListener("load", callback, false);
else if (window.attachEvent)
}
else if (window.attachEvent) {
window.attachEvent("onload", callback);
else window.onload = callback;
}
else
window.onload = callback;
})(window);
</script>'''

Expand Down