Hi, I am trying to highlight certain days with events on the calendar....I have to get the days from Model.
My code is as follows: <script type="text/javascript"> var datesArray = new Array(); for (var item in Model) { datesArray[datesArray.length] = "<%= item.PerformanceDate.Day %>"; } $(document).ready(function() { // Datepicker $('.datepicker').datepicker({ inline: true, beforeShowDay: function (date) { var theday = date.getDate(); if ($.inArray(theday, datesArray) <0) return [true, ""]; return [true, "specialDate"]; } }); }); It says item cant be found..cant we access model properties inside javascript?? Please reply.. Thanks a lot! Anusha Jimbo M wrote: > > > I've been playing with this all morning and nothing so far...can > anyone help a newbie? Hopefully I'll be up to speed soon and pulling > my own weight here. But in the meanwhile: > > I'm trying to populate the datepicker in inline mode so that certain > days are highlighted. I've boiled it down to a syntax that I feel > should work, but it doesn't and I'm stumped. Using filters such > as :even work, so why not this? > > $("#calendar").datepicker(); > var dates = [1, 5, 12, 21, 27, 30]; > $(dates).each(function(i, d) { > $("#calendar .ui-datepicker-days-cell a[text='" + d + > "']").addClass("myClass"); > }); > > css: > .myClass { > background-color: #88FF88; > } > > Can anyone spot what I'm missing here? Thanks... > > --- Jim --- > --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google Groups > "jQuery UI" group. > To post to this group, send email to jquery-ui@googlegroups.com > To unsubscribe from this group, send email to > jquery-ui+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/jquery-ui?hl=en > -~----------~----~----~----~------~----~------~--~--- > > > -- View this message in context: http://old.nabble.com/Highlighting-of-special-days-in-datepicker-tp19977382s27240p29209825.html Sent from the jQuery UI Discussion mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to jquery...@googlegroups.com. To unsubscribe from this group, send email to jquery-ui+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en.