Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3921

ROD grid loses scroll position when hiding/showing columns

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.5.2
    • 8.5.1.2
    • Components
    • Security Level: Jimmy
    • ZK 8.5.2 S1

      Steps to Reproduce

      open rod-grid-column-scroll-pos.zul
      scroll down until ROD loads new rows
      hide a column (using the column menu popup, or the debug buttons below the grid)

      Current Result

      scroll position changes to an incorrect position

      Expected Result

      scroll position should be preserved

      Debug Info

      after showing/hiding a column the scroll paddings tpad/bpad are reset to a 0 height.

      Workaround

      init the grid's scroll-paddings when changing the column visibility
      (causes a short flickering in FF, edge - chrome looks stable)

      	zk.afterLoad('zul.grid', function() {
      		var xColumn = {};
      		zk.override(zul.grid.Column.prototype, xColumn, {
      			setVisible : function() {
      				var result = xColumn.setVisible.apply(this, arguments);
      				setTimeout(() => this.getGrid()._initPadSizes(), 0);
      				return result;
      			}
      		});//zk.override
      	});//zk.afterLoad
      

            CharlesQiu CharlesQiu
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Time Spent - 7 hours Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - 7 hours Remaining Estimate - 1 hour
                7h