Announcement

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

    Timeline events disappear when resizeing/dragging

    SmartClient Version: v11.0p_2016-04-15/Pro Deployment (built 2016-04-15)

    Chrome Version 49.0.2623.112 m

    I am sorry to keep pestering you with timeline related issues but I now have a problem in my timeline where some of my events disappear when resizing or are not drawn at all.

    Here is a test case that shows the problem.
    If you resize any of the events they disappear, and the "Test 2" event is not even drawn to begin with.

    Test Case:
    Code:
        public Timeline getTimeline()
        {  
            final Timeline timeline = new Timeline();  
            timeline.setHeight100();
            timeline.setCanRemoveEvents(false);
            timeline.setCanEditLane(true);  
            timeline.setShowEventDescriptions(false);
            timeline.setEventSnapGap(1440); // 60 * 24
            timeline.setShowIndicators(true);
            timeline.setUseEventCanvasRolloverControls(false);
            timeline.setFirstDayOfWeek(0);
            timeline.setLaneEventPadding(2); // add a little space around events  
            timeline.setDisableWeekends(false);
            timeline.setShowWeekends(false);
            HeaderLevel[] headerLevels = new HeaderLevel[]{  
                new HeaderLevel(TimeUnit.WEEK),
                new HeaderLevel(TimeUnit.DAY)
            };  
            timeline.setHeaderLevels(headerLevels);  
            timeline.setLaneFields(new ListGridField[]{ new ListGridField("title", "Developer", 120)});  
            timeline.setLanes(TimelineLaneData.getRecords());  
            timeline.setData(TimelineData.getRecords());
            Date startDate = new Date(116, 4, 6);
            // if you don't call this, you'll get defaultTimelineColumnSpan columns (20)
            timeline.setStartDate(startDate);
            Date endDate = new Date(116, 5, 6);
            timeline.setEndDate(endDate);
            
            return timeline;
        }
        
        public static class TimelineData {  
              
            private static CalendarEvent[] records;
            
            public TimelineData() {  
            }  
            public static CalendarEvent[] getRecords() {  
                if (records == null) {  
                    records = getNewRecords2();  
                }  
                return records;  
            }  
          
            public static CalendarEvent[] getNewRecords2() {  
                
                return new CalendarEvent[]{  
                        new CalendarEvent(1, "Test 1", "", new Date(116, 4, 8), new Date(116, 4, 29), "charlesMadigen"),  
                        new CalendarEvent(2, "Test 2", "", new Date(116, 4, 1), new Date(116, 6 ,1), "charlesMadigen"),
                        new CalendarEvent(3, "Test 3", "", new Date(116, 4, 4), new Date(116, 4, 11), "charlesMadigen"),  
                        new CalendarEvent(4, "Test 4", "", new Date(116, 4, 4), new Date(116, 4, 11), "charlesMadigen")
                };  
            }
        }  
        
        public static class TimelineLaneData {  
              
            private static Lane[] records;  
          
            public static Lane[] getRecords() {  
                if (records == null) {  
                    records = getNewRecords();  
                }  
                return records;  
            }  
          
            public TimelineLaneData() {  
            }  
          
            public static Lane[] getNewRecords() {  
                Lane[] lanes = new Lane[]{  
                getLane("charlesMadigen", "Charles Madigen", "Managers"),  
                getLane("tamaraKane", "Tamara Kane", "Developers"),  
                getLane("darcyFeeney", "Darcy Feeney", "Managers"),  
                getLane("kaiKong", "Kai Kong", "Developers"),  
                getLane("shelleyFewel", "Shelley Fewel", "Managers"),  
                getLane("garretMonroe", "Garret Monroe", "Developers")  
                };  
                return lanes;  
            }  
          
            private static Lane getLane(String name, String title, String devGroup) {  
                Lane lane = new Lane(name, title);  
                lane.setAttribute("devGroup", devGroup);  
                return lane;  
            }  
        }
    }
    Last edited by Niels_EMP; 25 Apr 2016, 02:04.

    #2
    We'll take a look.

    Comment


      #3
      Hi,

      this one should be the same issue:
      http://forums.smartclient.com/forum/...-another-event

      Comment


        #4
        Niels_EMP - the bug isn't an overlap-related thing, but an issue with some internal logic that links a hidden snapGap to the next/previous visible ones - these links were wrong for snapGaps at the start or end of the timeline, when the dates they represented were hidden (a weekend, in this case).

        That's been fixed for tomorrow's builds.

        For now, you should find that just applying any positive time-portion to your endDate will fix your issue - it will cause the endDate to be rounded up, to a non-weekend date.

        andyx1975 - we'll look at your issue separately.

        Comment


          #5
          okay thank you... sounds good.

          Comment


            #6
            Isomorphic I never said it was overlap related, but great that it has been fixed!

            Comment


              #7
              Just tested with the latest nightly at issue is resolved, thank you.

              Comment

              Working...
              X