Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to hide event tooltip in calendar?

    I am using compact calendar in smartgwt showcase.

    http://www.smartclient.com/smartgwt/showcase/#compact_calendar_category

    I have implemented same like that.In my application I want to hide the tooltip on mouse over of each day in calendar.Right now it is showing the hour and event name.In my case Either I have to hide the whole tooltip or I want to show the tool tip with only Name.

    Can any one help me on this?
    Attached Files

    #2
    Have you get any result on this?

    Comment


      #3
      No. I have not yet solved that issue. :-(

      Comment


        #4
        I have removed the tooltip using the following code below.

        Originally posted by dineshv87
        No. I have not yet solved that issue. :-(
        Code:
        private Calendar calendar = new Calendar(){
        		@Override
        		@SuppressWarnings("deprecation")
        		protected String getDayBodyHTML(Date date, CalendarEvent[] events, Calendar calendar, int rowNum, int colNum) {
        			if(calendarEvents != null && calendarEvents.size() > 0) {
        				// Removing the tooltip
        				removeTooltipsFromCalendar(calendar,date);
                                        // ... 
                                 } 
                         } 
        });
        
        
        
        	/**
        	 * Removes the tool tips from the Calendar on the given date
        	 * @param calendar Calendar
        	 * @param date Date
        	 */
        	@SuppressWarnings("deprecation")
        	protected void removeTooltipsFromCalendar(Calendar calendar, Date date) {
        		if(calendar != null && date != null){
        			List<CalendarEvent> calendarEvents = new ArrayList<CalendarEvent>(Arrays.asList(calendar.getData()));
        			Iterator<CalendarEvent> iteratorEvents = calendarEvents.iterator();
        			while(iteratorEvents.hasNext()){
        				CalendarEvent calendarEvent = iteratorEvents.next();
        				if(	calendarEvent.getStartDate().getDate() == date.getDate() &&
        					calendarEvent.getStartDate().getMonth() == date.getMonth() ){
        					// Removing the event removes the tooltip 
        					iteratorEvents.remove();
        				}
        			}
        			CalendarEvent[] events = calendarEvents.toArray(new CalendarEvent[calendarEvents.size()]);
        			calendar.setData(events);
        		}
        	}
        Hope it helps.
        Best regards, doomed.

        Comment


          #5
          Originally posted by doomed
          I have removed the tooltip using the following code below.



          Code:
          private Calendar calendar = new Calendar(){
          		@Override
          		@SuppressWarnings("deprecation")
          		protected String getDayBodyHTML(Date date, CalendarEvent[] events, Calendar calendar, int rowNum, int colNum) {
          			if(calendarEvents != null && calendarEvents.size() > 0) {
          				// Removing the tooltip
          				removeTooltipsFromCalendar(calendar,date);
                                          // ... 
                                   } 
                           } 
          });
          
          
          
          	/**
          	 * Removes the tool tips from the Calendar on the given date
          	 * @param calendar Calendar
          	 * @param date Date
          	 */
          	@SuppressWarnings("deprecation")
          	protected void removeTooltipsFromCalendar(Calendar calendar, Date date) {
          		if(calendar != null && date != null){
          			List<CalendarEvent> calendarEvents = new ArrayList<CalendarEvent>(Arrays.asList(calendar.getData()));
          			Iterator<CalendarEvent> iteratorEvents = calendarEvents.iterator();
          			while(iteratorEvents.hasNext()){
          				CalendarEvent calendarEvent = iteratorEvents.next();
          				if(	calendarEvent.getStartDate().getDate() == date.getDate() &&
          					calendarEvent.getStartDate().getMonth() == date.getMonth() ){
          					// Removing the event removes the tooltip 
          					iteratorEvents.remove();
          				}
          			}
          			CalendarEvent[] events = calendarEvents.toArray(new CalendarEvent[calendarEvents.size()]);
          			calendar.setData(events);
          		}
          	}
          Hope it helps.
          Best regards, doomed.
          Thanks for the solution. Will try it soon. :-)

          Comment

          Working...
          X