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

listbox empty message sizing with hidden columns (wrong colspan)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.5.1.1
    • Fix Version/s: 8.5.2
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:

      Description

      Steps to Reproduce

      run the attachment empty-listbox-with-hidden-column.zul
      compare the positions/sizes of the empty messages

      Current Result

      depending on which columns are invisible the size and position varies between different listboxes, if the first column is invisible the message even line breaks

      Expected Result

      empty message cell should span over all columns to have the whole table width available for an "empty-message"

      Debug Info

      the colspan attribute is calculated incorrectly - ignoring invisible columns

      Root Cause

      https://github.com/zkoss/zk/blob/44033b6a35d00482dd9c47ef724f167c4768b252/zul/src/archive/web/js/zul/sel/Listbox.js#L33

      Workaround

      currently commented out in empty-listbox-with-hidden-column.zul

      	zk.afterLoad('zul.sel', function() {
      		var xListbox = {};
      		zk.override(zul.sel.Listbox.prototype, xListbox, {
      			bind_ : function(desktop, skipper, after) {
      				var result = xListbox.bind_.apply(this, arguments);
      				var wgt = this;
      				after.push(function() {
      					if(wgt.listhead) {
      						wgt.$n('empty').colSpan = wgt.listhead.nChildren;
      					}
      				});
      			}
      		});//zk.override
      	});//zk.afterLoad
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                CharlesQiu CharlesQiu
                Reporter:
                cor3000 cor3000
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 day
                  1d
                  Remaining:
                  Time Spent - 2 hours Remaining Estimate - 6 hours
                  6h
                  Logged:
                  Time Spent - 2 hours Remaining Estimate - 6 hours
                  2h