i am working to get a year calendar that looks and behaves exactly the same as the inline datepickers assigned to input fields on site. So i created this block
<div class="box_content">
<div class="yearCal" id="cal2"><!-- this will receive the calendar --></div>
</div>
and assigned the datepicker object to the element with id 'cal2'. This renders me the calendar widget showing 12 months. Every td element looks like this:
<td about="I receive class 'free' or 'booked' from 'BeforeShowDay' handler">
<a about="I am the element catching the click and need the parent class"></a>
</td>
I testwise configured the datepicker's onSelect function using this code
onSelect: function(dateText, inst) {
console.debug( jQuery(this).parent().attr('class') );
}
But when i click on a calendar day i get the id 'box_content'. No matter what i try, i dont get the parental element. But i need to get it since every td elements is getting a 'free' or 'booked' class when the widget is getting rendered and depending on its class i have to do some database action.
Can you please tell me how to do it right?