Announcement

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

    Losing lane height in Calendar after rebuild of CalendarView

    Hi,

    After rebuilding the timeline view in a calendar the height of all lanes are reset to the default lane height.
    I recently updated my SmartGWT version (see below) and in the old version the lane heights were retained.
    Is there currently a way to keep the lane heights across rebuilds?

    Context:
    Old SmartGWT Version: v12.1p_2021-02-05/LGPL Development Only (built 2021-02-05)
    New SmartGWT Version: v12.1p_2021-06-03/LGPL Development Only (built 2021-06-03)
    GWT Version: 2.9.0
    Tested in Super Dev mode and compiled mode.
    Behavior is the same across the following browsers:
    Chrome - Latest version
    Edge - Latest version
    IE - Latest version


    Code:
    public class LMSEntryPoint extends SmartGwtEntryPoint
    {
       @Override
       public void onModuleLoad()
       {
          Calendar calendar = new Timeline();
          Lane[] lanes = new Lane[1];
          lanes[0] = new Lane("a", "A");
          lanes[0].setHeight(10);
          calendar.setLanes(lanes);
          calendar.draw();
          calendar.getLane("a").setHeight(10);
          calendar.getSelectedView().rebuild();
       }
    }
    Before the rebuild the height is 10, after the rebuild the height is 60 (default cell height).

    Note:
    In the old version the lane height was set by the following function in ISC_Calendar.js (called by isc_TimelineView_setLanes, which in turn is called by isc_TimelineView__rebuild):

    Code:
    isc_TimelineView_getLaneHeight(_1) {
    	if (_1 == null)
    		return;
    	if (isc.isA.Number(_1))
    		_1 = this.getRecord(_1);
    	else if (isc.isA.String(_1))
    		_1 = this.getLane(_1);
    	return (_1 && _1.height) || this.cellHeight
    }
    In the new version the function is:
    Code:
    function isc_TimelineView_getLaneHeight(_1) {
    	var _2 = isc.isA.String(_1) ? _1 : (isc.isAn.Object(_1) ? _1.name : null);
    	var _3 = this.cellHeight;
    	if (!_2) {
    		if (isc.isA.Number(_1))
    			_1 = this.getRecord(_1);
    		if (_1) {
    			_2 = _1.name;
    			if (_1.height != null)
    				_3 = _1.height;
    			_1 = null
    		}
    	}
    	var _4 = this.laneHeightCache[_2];
    	if (_4 == null) {
    		this.laneHeightCache[_2] = _3
    	}
    	return this.laneHeightCache[_2]
    }
    So the lane height doesn't end up in the laneHeightCache (because setLanes gives it an object argument).
    As far as I could see the only place where the laneHeightCache entries are set is in isc_TimelineView_getLaneHeight, so I am not sure how to keep the heights cached.

    #2
    This has been fixed for builds dated June 9 and later.

    Comment

    Working...
    X