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

Grid columns onChildAdded removes the scrollbar faker column, cause desync with content

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.5.1.2, 8.6.0.1
    • Fix Version/s: 9.0.0
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None

      Description

      Steps to Reproduce

      Run fiddle:
      http://zkfiddle.org/sample/2im5kjg/2-Columns-and-Cells-not-in-sync-after-appending-column#source-1
      Click on Append column
      Click on show all

      Current Result

      When appending a column, the scrollbar faker is removed if the grid doesn't currently need to display a scrollbar (content height < grid height)
      However, when more items are added to the grid and a scrollbar is shown, the column faker is still not available, which cause the grid content to scroll further than the headers.

      Expected Result

      Adding a column should not remove the scrollbar faker div

      Debug Info

      https://github.com/zkoss/zk/blob/7b60924474ecaf28deb0855a6a5714b2e03df825/zul/src/archive/web/js/zul/mesh/HeadWidget.js#L196-L210

      Root Cause

      Workaround

      rerender the grid on adding a column:

      <script><![CDATA[
      		zk.afterLoad('zul.mesh', function() {
      			var xColumnMenuWidget = {};
      			zk.override(zul.mesh.ColumnMenuWidget.prototype, xColumnMenuWidget ,{
      				onChildAdded_ : function() {
      					var result = xColumnMenuWidget.onChildAdded_.apply(this, arguments);
      					this.rerender();
      					return result;
      				}
      			});//zk.override
      		});//zk.afterLoad
      		]]></script>
      

        Attachments

          Activity

            People

            • Assignee:
              rudyhuang rudyhuang
              Reporter:
              MDuchemin MDuchemin
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                3h