jQuery UI datepicker - add static text underneath the calendar? -


This is the one that pops up when you click on the linked input element I have some static text below the dates table I want to be able to get involved which will be visible and even when the user scrolls for different months.

I with jQuery, / P> $ ('.ui-datepicker'). (After 'text');

.ui-datepicker on the square. With that problem, when the user was scrolled next month, it did not work. I was able to fix it, it was actually hacked by continuously clearing and reconnecting the text with setTimeout , but it worked.

The next problem came when there were many calendars on my page, with different texts I tried to target specific examples on the .ui-datepicker with the above method, But I found out that in fact only an example of DatePicker is shared between all the calendar areas on the page.

So is it really possible?

To present different texts on multiple datepickers on the same page, each solution will have an address id / Next to the class space is to create the data holder, after which, to collect the data, load the datacock selected by using (this).

Example html code: The specific text that is displayed for the related datepicker in the data holder is as follows:

  & lt; P & gt; Date1: & lt; Input type = "text" class = "dated picker" data-dtptx = "text 1 to display in datepick" & gt; & Lt; / P & gt; & Lt; P & gt; Date 2: & lt; Input type = "text" class = "dated picker" data-dpTtxt = "second text to display" & gt; & Lt; / P & gt;  

Example jQuery code: Then jQuery text injection in the selected datepicker calendar will be something like this:

  $ (".datepicker ") .datepicker () .on (" click ", function () {var dTxt = $ (this). Data ('dptxt'); $ ('.ui-datepicker-calendar'). ('& Lt; span Class = "middle" & gt; '+ dTxt +' & lt; / & gt; ');});  

I've added a little CSS formatting so that you can easily see additional semi-dynamic text between two dates.

See my work Solution is in action (picture below JSFDL link):


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -