framework7

Open full view…

open calendar when clicking a link

krisreddy
Fri, 12 Feb 2016 21:30:11 GMT

I would like to open a calendar by clicking on a link - say for example --- <a href="#" class="open-calendar">Calendar<input type="hidden" id="cal-input"></a> $$(".open-calendar").on("click",function(){ myApp.calendar({ input:"#cal-input" }); }); --- This does not work? Any help would be appreciated. Thanks, Kris

plpl
Fri, 12 Feb 2016 22:51:37 GMT

remove hidden type

krisreddy
Fri, 12 Feb 2016 23:14:59 GMT

I don't want to show the input -

plpl
Fri, 12 Feb 2016 23:27:37 GMT

--- <a href="#" class="open-calendar">Calendar</a> $$(".open-calendar").on("click",function(){ myApp.calendar({ input:this }); });

krisreddy
Sat, 13 Feb 2016 03:13:07 GMT

@plpl thank you!

Vladimir Kharlampidi
Sun, 14 Feb 2016 11:59:24 GMT

Not good idea to create/init calendar everytime you click the link. Just: --- var myCal = myApp.calendar({...}); $$(".open-calendar").on("click",function(){ myCal.open(); });

dhir
Mon, 22 Jan 2018 11:20:21 GMT

same problem here, still with v1. it's not working with both methods. it works with the <input id=""> mentioned on param input: , but the calendar modal won't showing. it didn't go up. why is that? 6 hours wondering why.

dhir
Mon, 22 Jan 2018 13:41:55 GMT

nevermind .. it solved i manage to make a calendar inline and add it a toggleClass to show it up