CleanCalendar in JQuery

I m Using calendar.js file to implement calendar in my application. Actually this .js calendar has a string that takes the class name and the id name of my app.

In my application I am having these lines

 <input type="text" class="calendarSelectDate" />
 <div id="calendarDiv"></div>

      

When I click on this textbox, it will generate a calendar in the DIv tag.

.. But if I created an input tag and a Div tag of my own using JQuery

$ ("1"). appendTo ("# hold1"); $ (") (# HOLD1") appendTo. "; And use the same class, Calendar is not generated .... Suggest ME

0


a source to share


3 answers


Calendar .js-script runs on load and hooks up the events needed to display the calendar. If you add the input and div at some later point using jQuery, the events won't hook up.

If you add them to your own script with jQuery, you can solve your problem simply by moving the calendar.js-script tag after the script tag with your code in it.



If you are dynamically adding elements after the page has loaded, you need to figure out the inner workings of calendar.js and call its initialization again.

+1


a source


I'm not familiar with CleanCalendar, I had good experience with JQueryUI Datepicker control .



0


a source


You have to call a string that takes the class name and div id AFTER creating the div and input with jquery.

Perhaps when u calls this line, it binds the showCalendar event to elements with that class / id. But since you are creating the div / input after the event has been created (I assume), the event will not be attached to these dynamically created elements.

0


a source







All Articles