Solved

asp calendar - customize display

Posted on 2013-12-11
4
405 Views
Last Modified: 2013-12-11
Hi
My organization is using a classic asp calendar to display events. Each day displays the name of the event and the starting time. Sometimes there are repeating events on the same day with different starting times. This causes a redundant display of event names for the same day. I would like to leave only the first instance of a repeating event name and just show the different starting times.
I can't figure out how to do this. Is there some way of manipulating the recordset or the display, in Jquery maybe, to remove certain entries?
Here is the calendar:
http://www.imj.org.il/vision/calendar/
Thanks,
Avi
0
Comment
Question by:avir
  • 2
  • 2
4 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 39711042
Do you want to do that with jQuery after loading the page?
0
 

Author Comment

by:avir
ID: 39711048
That could be good.
I thought of surrounding each event name with a div and assigning its name as a class and then removing all of them except the first. But I'm not sure of how to do this.
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 39711054
The following do the thing :
$(document).ready(function() {
	var calendar = $(".nine.large-9.columns.col-content");
	var days = $("td", calendar); 
	days.each(function() {
		var dis = $(this);
		$("div.item a", dis).map(function() {
			var value = $(this).text();
			var with_same_value = $("div.item a", dis).filter(function() { return $(this).text()==value; });
			var duplicates = with_same_value.not(":first");
			var calendar_events = duplicates.closest("div");
			calendar_events.remove();
		});
	});	
});

Open in new window

work
0
 

Author Closing Comment

by:avir
ID: 39711076
Very good, except it also removed the hours. But I fixed it by taking the hours out of the div.
Thank you very much.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now