Announcement

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

    Timeline, Hover on lanes

    Hi,

    Is there a way to add hover for lanes ?
    I tried setting ListGridField.setShowHover(true) but it does not work.

    Thanks

    #2
    Hi Isomorphic,

    SmartClient Version: v10.0p_2015-06-20/LGPL Development Only (built 2015-06-20)
    Browsers
    FireFox - 26.0
    Chrome - Version 43.0.2357.124 (64-bit)


    1) Timeline, I would like to add hover for lane, so i tried this
    I modified SimpleTimelineSample like this
    Code:
    	public Canvas getViewPanel() {
    		Timeline calendar = new Timeline();
    		calendar.setHeight(451);
    
    		HeaderLevel[] headerLevels = new HeaderLevel[] { //
    		new HeaderLevel(TimeUnit.WEEK), //
    				new HeaderLevel(TimeUnit.DAY) //
    		};
    		calendar.setHeaderLevels(headerLevels);
    
    		ListGridField titleLane = new ListGridField("title", "Developer", 120);
    		titleLane.setShowHover(true);
    		titleLane.setHoverCustomizer(new HoverCustomizer() {
    			@Override
    			public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
    				return "This is my email";
    			}
    		});
    		calendar.setLaneFields(new ListGridField[] { titleLane });
    		calendar.setLanes(TimelineLaneData.getRecords());
    
    		return calendar;
    	}
    It does not work. Is there a way to do this ?


    2) Timeline, Is it possible to have a context menu for a lane ?
    How should I try ?


    3) Problem with setTodayBackgroundColor for Calendar
    In SimpleCalendarSample, in the method getViewPanel() just add the line with setTodayBackgroundColor
    Code:
    	public Canvas getViewPanel() {
    		Calendar calendar = new Calendar();
    		calendar.setData(CalendarData.getRecords());
    		calendar.setTodayBackgroundColor("yellow");
    		return calendar;
    	}
    When you want to create an event and start dragging in today column, the selected area is not highlighted like in any other column.

    Comment


      #3
      Originally posted by costy View Post
      Hi,

      Is there a way to add hover for lanes ?
      I tried setting ListGridField.setShowHover(true) but it does not work.

      Thanks
      Timeline.setShowLaneFieldHovers(true);
      and Timeline.setCellHoverCustomizer() is working for me.
      setEventHoverHTMLCustomizer() in case of event hover customization.
      MichalG

      Comment


        #4
        Thank you michalg,

        It works. Obviously i did not search enough.

        Do you have a solution for a contextMenu on lane fields ?
        I tried with AutoChildProperties on timelineView, still no luck.

        Comment


          #5
          Take a look at the doc for Calendar.showViewHovers, which links to a number of related hover settings (you can show hovers over date-cells, lane-fields, events, headers and during drags).

          For cell-based context menus, CalendarViews extend ListGrid, which supports CellContextClickEvent - so you should be able to apply one of these to a CalendarView and apply that to your Calendar via setAutoChildProperties("timelineView", x).

          Comment


            #6
            Hi Isomorphic,

            For hovers, it is my fault. I did not search enough.
            Thank you for the context menu tip, it works.

            Great library, great work.
            Thanks.

            Comment

            Working...
            X