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

Javadoc doesn't match code for grid's setSpan method.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 5.0.9
    • 5.0.8
    • ZHTML
    • None
    • firefox 5.0 and IE 9 windows 7

      The javadoc for the Grid's setSpan(int) method states that the column number is 1 based, but, it is 0 based (e.g. setSpan(0) sets the extra space in column 1, setSpan(1) sets the extra space in column 2).

      To test:

      <vbox spacing="1em">
      <grid width="400px" span="0" sizedByContent="false"  >
             <columns sizable="true">
                     <column label="id" width="40px"/>
                     <column label="name" width="100px"/>
             </columns>
             <rows>
                     <row>
                             <label value="span = 0"/>
                             <label value="John Smith"/>
                     </row>
             </rows>
      </grid>
      <grid width="400px" span="1" sizedByContent="false"  >
             <columns sizable="true">
                     <column label="id" width="40px"/>
                     <column label="name" width="100px"/>
             </columns>
             <rows>
                     <row>
                             <label value="span = 1"/>
                             <label value="John Smith"/>
                     </row>
             </rows>
      </grid>
      </vbox>
      

      The javadoc:

             /**
              * Sets column span hint of this component.
              * <p>String number span indicates how this component distributes remaining empty space to the
              * specified column(1-based). "1" means distribute remaining empty space to the 1st column; "2" means
              * distribute remaining empty space to the 2nd column, etc.. The spanning column will grow to
              * fit the extra remaining space.</p>
              * <p>Special span hint with "true" means span ALL columns proportionally per their
              * original widths while null or "false" means NOT spanning any column.</p>
              * <p>Default: null. That is, NOT span any column.</p>
              * <p>Note span is meaningful only if there is remaining empty space for columns.</p>
              *
              * @param span the column span hint.
              * @since 5.0.6
              * @see #getSpan
              * @see #setSpan(boolean)
              */
      

            SimonPai SimonPai
            jimmyshiau jimmyshiau
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: