[SOLVED] Calender/Datepicker On Ajax Pages

Hello team,

I am looking on how to create a calender/ datepicker on a page that wasn’t initially in the DOM. It is just redirected to as a 'resolve' inasync route. I previously was able to create it on a pop up but now, I don’t know how I am supposed to create it since I can’t directly access the el.

var calendarModal = app.calendar.create({ inputEl: '#demo-calendar-modal',---ISSUE IS HERE--- openIn: 'customModal', header: true, footer: true, dateFormat: 'MM dd yyyy', });

I always access DOM on these pages by doing something like;

Now I don’t know how to go about it… Thanks very much. Blessings!

Check Router Component http://framework7.io/docs/router-component.html to load pages by componentUrl it allows to handle page-related scripts in right way. Also check Kitchen Sink calendar examples that loaded as component https://github.com/framework7io/framework7/blob/master/kitchen-sink/core/pages/calendar.html

1 Like


Thanks @nolimits4web