[ 12 posts ] Go to page 1, 2 Next

clayton miller

  • Username: mxpimp47
  • Joined: Thu Dec 03, 2009 12:16 pm
  • Posts: 4
  • Offline
  • Profile

how to specify dates to be highlighted that have an entry

Post Posted: Thu Dec 03, 2009 12:32 pm
+0-
i have google'd it and searched the forum. maybe i don't know the proper terminology to search. but i want the calendar to display dates that have an entry to be highlighted when the browser loads the page. and when users scroll to different months it will show scheduled dates as well. that way visitors dont have to click everyday to see if there is an event. any help would be greatly appreciated.

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile

Re: how to specify dates to be highlighted that have an entry

Post Posted: Thu Dec 03, 2009 12:34 pm
+0-
You want the "selected" config option:
http://developer.yahoo.com/yui/docs/YAH ... g_selected

This example does that:
http://blog.davglass.com/files/yui/cal5/

clayton miller

  • Username: mxpimp47
  • Joined: Thu Dec 03, 2009 12:16 pm
  • Posts: 4
  • Offline
  • Profile

Re: how to specify dates to be highlighted that have an entry

Post Posted: Thu Dec 03, 2009 1:09 pm
+0-
thank you for such a quick response! how exactly do i implement that? which file is that code in? i am very new with this type of code. just need some direction and i can get it done! thanks again for the fast response!

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile
Tags:

Re: how to specify dates to be highlighted that have an entry

Post Posted: Thu Dec 03, 2009 1:12 pm
+0-
This should work (haven't tested it, but it should):

Example

Click here to see the revision history on this Gist.

Camillo

  • Username: Camillo
  • Joined: Tue Dec 29, 2009 12:47 pm
  • Posts: 4
  • GitHub: Camillo
  • Gists: Camillo
  • Offline
  • Profile

Re: how to specify dates to be highlighted that have an entry

Post Posted: Tue Dec 29, 2009 1:04 pm
+0-
Hello,

I need more information about highlight dates.

The selected option is not satisfactory because when i click on this cell, the highlight disappear.

Is it possible to highlight a date after call.render() ? Particularly when users scroll to different months, because I have a lot of entries in a month and I don't want to preload all entries.

I tried to use addRenderer function but I doesn't work when it's inside a handle event function like beforeRenderEvent or changePageEvent.

Thanks for your help.

Satyen Desai

YUI Developer

  • Username: sdesai
  • Joined: Tue Dec 09, 2008 4:17 pm
  • Posts: 302
  • GitHub: sdesai
  • Gists: sdesai
  • YUI Developer
  • Offline
  • Profile

Re: how to specify dates to be highlighted that have an entry

Post Posted: Mon Jan 04, 2010 11:39 am
+0-
Hi,

See if the following help:

1). Adding renderers, after render
http://yuiblog.com/sandbox/yui/v250/exa ... erers.html

2). Avoiding scalability issues with lots of renderers
http://yuiblog.com/sandbox/yui/v241/exa ... mance.html

Regards,
Satyen

Roman Hoyenko

  • Username: hoyenko
  • Joined: Wed Dec 02, 2009 1:09 pm
  • Posts: 30
  • GitHub: Romario
  • Gists: Romario
  • Offline
  • Profile
Tags:

Re: how to specify dates to be highlighted that have an entry

Post Posted: Wed Jan 06, 2010 4:46 pm
+0-
I have a similar problem - I need to only allow selection of certain dates. Is there a way to make all the dates non-selectable by default?

I created custom renderers for the dates that are allowed for selection and they work fine.

I guess I need to redefine .selectable class to have no link by default and only add link in custom renderer. Is this how it should be done?

Satyen Desai

YUI Developer

  • Username: sdesai
  • Joined: Tue Dec 09, 2008 4:17 pm
  • Posts: 302
  • GitHub: sdesai
  • Gists: sdesai
  • YUI Developer
  • Offline
  • Profile

Re: how to specify dates to be highlighted that have an entry

Post Posted: Wed Jan 06, 2010 4:55 pm
+0-
If a majority of your dates are going to be "unselectable", the easiest way is to override the default cell renderer, similar to this example:

http://ericmiraglia.com/yui/demos/readonlycalendar.php

Regards,
Satyen

Roman Hoyenko

  • Username: hoyenko
  • Joined: Wed Dec 02, 2009 1:09 pm
  • Posts: 30
  • GitHub: Romario
  • Gists: Romario
  • Offline
  • Profile
Tags:

Re: how to specify dates to be highlighted that have an entry

Post Posted: Wed Jan 06, 2010 5:13 pm
+0-
sdesai wrote:
If a majority of your dates are going to be "unselectable", the easiest way is to override the default cell renderer, similar to this example:

http://ericmiraglia.com/yui/demos/readonlycalendar.php


Yes, they are mostly empty. I tried and it is almost what I need, the only thing is that it still shows the hand icon and the current date is black on black. I guess I need to do something with styles.

Do you know what do I need to do with the custom renderers in order for me to be able to fire select events? Add Style.CSS_CELL_SELECTOR ?

And thanks for very quick answer!

Roman Hoyenko

  • Username: hoyenko
  • Joined: Wed Dec 02, 2009 1:09 pm
  • Posts: 30
  • GitHub: Romario
  • Gists: Romario
  • Offline
  • Profile
Tags:

Re: how to specify dates to be highlighted that have an entry

Post Posted: Wed Jan 06, 2010 5:20 pm
+0-
Looks like this works:

cal.renderCellDefault = function(workingDate, cell) {
cell.innerHTML = this.buildDayLabel(workingDate);
YAHOO.util.Dom.removeClass(cell, "selectable");
};

this makes all cells non-selectable.

But when I try to add the class in my custom renderer:
YAHOO.util.Dom.addClass(cell, "selectable");

it doesn't change the cell. Anything else I should do?
  [ 12 posts ] Go to page 1, 2 Next
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum