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

listbox empty message sizing with hidden columns (wrong colspan)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.5.2
    • 8.5.1.1
    • Components
    • Security Level: Jimmy

      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
      

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

              Created:
              Updated:
              Resolved:

                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