Announcement

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

    Creation of Timeline aborts with js-error

    Hey guys,

    recently we found out that the calendar/timeline is not displayed correctly anymore.
    If we want to display an event that starts before and ends after the displayed dateinterval, the following errors occur:
    "TypeError: _7 is undefined" (in Firefox) or "Uncaught TypeError: Cannot read property 'totalSlots' of undefined" (in Chrome).
    As in the example the example doesn't load at all.

    Code:
    isc.Timeline.create({
    	"ID" : "timeline",
    	"width" : "100%",
    	"height" : "100%",
    	"overflow" : "auto",
    	"hideUsingDisplayNone" : false,
    	"startDate" : new Date(2015, 2, 2),
    	"endDate" : new Date(2015, 2, 29),
    	"headerLevels" :
    	[{
    			"unit" : "week"
    		}, {
    			"unit" : "day",
    			"titleFormatter" : function (headerLevel, startDate, endDate, defaultValue, viewer) {
    				return startDate;
    			},
    			"headerWidth" : 39
    		}
    	],
    	"canEditEvents" : false,
    	"canCreateEvents" : false,
    	"autoFetchData" : true,
    	"showControlsBar" : false,
    	"firstDayOfWeek" : 1,
    	"weekPrefix" : "Calendar week",
    	"todayBackgroundColor" : "#E0E0E0",
    	"showEventDescriptions" : false,
    	"showEventHeaders" : false,
    	"getEventHoverHTML" : function (event, eventWindow) {
    		var result = "";
    		if (event.showDate) {
    			var beginDateString = event.startDate.toShortDate(this.dateFormatter, false);
    			var endDateString = event.endDate.toShortDate(this.dateFormatter, false);
    			var showEventTime = event.isTrip;
    			result += beginDateString;
    			if (showEventTime) {
    				result += " ";
    				result += isc.Time.toTime(event.startDate, this.timeFormatter, true);
    			}
    			if (beginDateString != endDateString) {
    				result += " - ";
    				result += endDateString;
    			} else if (showEventTime)
    				result += " - ";
    			if (showEventTime) {
    				result += " ";
    				result += isc.Time.toTime(event.endDate, this.timeFormatter, true);
    			}
    			result += "<BR><BR>";
    		}
    		result += event.description;
    		return result;
    	},
    	"getDateCSSText" : function (date, rowNum, colNum, viewer) {
    		if (colNum != 0 && (date.getDay() == 6 || date.getDay() == 0))
    			return "background-color: #74A5D2";
    		else
    			return this.Super("getDateCSSText", arguments);
    	},
    	"eventSnapGap" : 37,
    	"labelColumnWidth" : 200,
    	"alternateLaneStyles" : true,
    	"laneFields" :
    	[{			
    			"name" : "title",
    			"title" : "&nbsp",
    			"type" : "text",
    			"canEdit" : false
    		}
    	],
    	"lanes" :
    	[ {
    			"hierarchyLevel" : 1,
    			"isOpen" : false,
    			"height" : 30,
    			"isFolder" : false,
    			"name" : "61",
    			"title" : "a, a"
    		}, {
    			"hierarchyLevel" : 1,
    			"isOpen" : false,
    			"height" : 30,
    			"isFolder" : false,
    			"name" : "60",
    			"title" : "b, b"
    		}, {
    			"hierarchyLevel" : 1,
    			"isOpen" : false,
    			"height" : 30,
    			"isFolder" : false,
    			"name" : "61",
    			"title" : "c, c"
    		}, {
    			"hierarchyLevel" : 1,
    			"isOpen" : false,
    			"height" : 30,
    			"isFolder" : false,
    			"name" : "60",
    			"title" : "d, d"
    		},
    	],
    	"data" :
    	[{
    			"lane" : "61",
    			"isTrip" : false,
    			"description" : "An Event",
    			"startDate" : new Date(2015, 1, 2, 0, 0),
    			"timelineGeneratedIndex" : "2",
    			"backgroundColor" : "#00BD02",
    			"showDate" : true,
    			"endDate" : new Date(2015, 2, 30, 23, 59),
    			"name" : "&nbsp"
    		}]
    })

    This happens with the latest nightly v10.0p_2015-02-28

    Best regards
    Last edited by SimonF; 2 Mar 2015, 23:48.

    #2
    Sadly this bug has reached our productive release, so we need this bug fixed as soon as possible.
    It seems that this bug was released between the smartclient-versions between 12nd february(SmartClient_v100p_2015-02-12_Pro) and 20th february (SmartClient_v100p_2015-02-20_Pro).

    This is the first screen:


    correct behaviour after clicking the button with version from 12 february:


    wrong behaviour after clicking the button with version after 20th february:


    here is the example for reproducing this behavior.
    Code:
    isc.VLayout.create({
    	"width" : "100%",
    	"height" : "100%",
    	"autoDraw" : true,
    	"hideUsingDisplayNone" : false,
    	"leaveScrollbarGap" : false,
    	"members" :
    	[isc.ToolStrip.create({
    		"width" : "100%",
    		"hideUsingDisplayNone" : false,
    		"layoutLeftMargin" : 3,
    		"layoutRightMargin" : 3,
    		"leaveScrollbarGap" : false,
    		"members" :
    		[isc.Button.create({
    			"click" : function () {
    				timeline.setLanes([{
    					"isOpen" : true,
    					"height" : 30,
    					"isFolder" : true,
    					"name" : "1",
    					"title" : "a"
    				}, {
    					"isOpen" : false,
    					"height" : 30,
    					"isFolder" : false,
    					"name" : "61",
    					"title" : "b"
    				}, {
    					"isOpen" : false,
    					"height" : 30,
    					"isFolder" : false,
    					"name" : "60",
    					"title" : "c"
    				}, {
    					"isOpen" : false,
    					"height" : 30,
    					"isFolder" : false,
    					"name" : "58",
    					"title" : "d"
    				}, {
    					"isOpen" : false,
    					"height" : 30,
    					"isFolder" : false,
    					"name" : "57",
    					"title" : "e"
    				}, {
    					"isOpen" : false,
    					"height" : 30,
    					"isFolder" : false,
    					"name" : "56",
    					"title" : "f"
    				}]);
    				timeline.setData([{
    					"lane" : "61",
    					"isTrip" : false,
    					"description" : "An Event",
    					"startDate" : new Date(2015, 1, 2, 0, 0),
    					"timelineGeneratedIndex" : "2",
    					"backgroundColor" : "#00BD02",
    					"showDate" : true,
    					"endDate" : new Date(2015, 2, 30, 23, 59),
    					"name" : "&nbsp"
    				}]);
    			},
    			"overflow" : "visible",
    			"tabIndex" : 0,
    			"hoverDelay" : 1200,
    			"hideUsingDisplayNone" : false,
    			"title" : "Insert lanes and one event",
    			"hiliteAccessKey" : true,
    			"showDisabledIcon" : false
    		})
    	]
    }),
    isc.Timeline.create({
    	"ID" : "timeline",
    	"width" : "100%",
    	"height" : "100%",
    	"overflow" : "auto",
    	"hideUsingDisplayNone" : false,
    	"startDate" : new Date(2015, 2, 2),
    	"endDate" : new Date(2015, 2, 29),
    	
    	"canEditEvents" : false,
    	"canCreateEvents" : false,
    	"autoFetchData" : true,
    	"showControlsBar" : false,
    	"firstDayOfWeek" : 1,
    	"weekPrefix" : "Clander week",
    	"todayBackgroundColor" : "#E0E0E0",
    	"showEventDescriptions" : false,
    	"showEventHeaders" : false,
    	"getEventHoverHTML" : function (event, eventWindow) {
    		var result = "this is a description";
    		return result;
    	},
    	"getDateCSSText" : function (date, rowNum, colNum, viewer) {
    		if (colNum != 0 && (date.getDay() == 6 || date.getDay() == 0))
    			return "background-color: #74A5D2";
    		else
    			return this.Super("getDateCSSText", arguments);
    	},
    	"eventSnapGap" : 37,
    	"labelColumnWidth" : 200,
    	"alternateLaneStyles" : true,
    	"laneFields" :
    	[{			
    		"name" : "title",
    		"title" : "&nbsp",
    		"type" : "text",
    		"canEdit" : false
    	}],
    	"lanes" :
    	[{
    			"isOpen" : false,
    			"height" : 30,
    			"isFolder" : true,
    			"name" : "1",
    			"title" : "a"
    		}],
    	"data" :
    	[]
    })]})
    Best regards

    Comment


      #3
      Dear Isomorphic-Team,
      Is this issue under review? Are there any news about this?

      Best Regards

      Comment


        #4
        This issue is assigned for a developer for investigation and we will follow up with more information when we have it (should be shortly)

        Regards
        Isomorphic Software

        Comment


          #5
          This bug has been fixed in builds dated March 8 and later.

          As an aside, we see you're using an eventSnapGap of 37 - note that this is a minute interval, not a pixel interval.
          Last edited by Isomorphic; 6 Mar 2015, 22:28.

          Comment


            #6
            is this bug really solved? When I am filtering the events by name and I am entering a value which does not exist. I get the following error message:

            Code:
            23:49:36.733:TMR7:WARN:Log:TypeError: Cannot read property 'totalSlots' of null
            Stack from error.stack:
            	TimelineView.adjustDimensionsForOverlap(<no args: exited>) on [TimelineView ID:isc_Timeline_0_timelineView] @ ISC_Calendar.js:116:451
            	TimelineView.sizeEventCanvas(<no args: exited>) on [TimelineView ID:isc_Timeline_0_timelineView] @ ISC_Calendar.js:114:103
            	TimelineView.addEvent(<no args: exited>) on [TimelineView ID:isc_Timeline_0_timelineView] @ ISC_Calendar.js:173:299
            	TimelineView.refreshVisibleEvents(<no args: exited>) on [TimelineView ID:isc_Timeline_0_timelineView] @ ISC_Calendar.js:156:123
            	TimelineView.refreshEvents(<no args: exited>) on [TimelineView ID:isc_Timeline_0_timelineView] @ ISC_Calendar.js:188:6
            	Timeline.refreshSelectedView(<no args: exited>) on [Timeline ID:isc_Timeline_0] @ ISC_Calendar.js:371:1189
            	Timeline.dataChanged(<no args: exited>) on [Timeline ID:isc_Timeline_0] @ ISC_Calendar.js:371:272
            	ResultSet.eval(<no args: exited>) on [ResultSet ID:isc_ResultSet_5 (dataSource: timeline_1613887903, created by: isc_Timeline_0)] @ [no file]:2:10
            	Timeline.thunk(<no args: exited>) on [Timeline ID:isc_Timeline_0] @ ISC_Core.js:303:28
            	ResultSet.observation(<no args: exited>) on [ResultSet ID:isc_ResultSet_5 (dataSource: timeline_1613887903, created by: isc_Timeline_0)] @ ISC_Core.js:300:378
            After that, my timeline is emply. I need to close it and reopen it.
            Last edited by andyx1975; 5 Jul 2015, 13:54.

            Comment


              #7
              It was fixed quite a long time ago, but some other changes have been made in this area since then, so we can take another look.

              What's your exact build string?

              Comment


                #8
                I tried this build:
                https://www.smartclient.com/builds/SmartGWT/5.0p/LGPL/2015-07-04

                I can not reproduce this error in superDevMode or in ClassicDevMode. Which is really strange.

                Comment


                  #9
                  Hi,

                  so I played a little bit around... it seems that this error appears if you hide empty lanes. They do not reappear anymore. So the option setHideUnusedLanes( true ); can not be used.

                  Thanks
                  Andy

                  Comment

                  Working...
                  X