Search code examples
gridscrollbarzk

ZK grid scroll bar problems


I want to create grid with minimal width whitch depends on it's data. The grid height has to be defined. And I don't want any horizontal scroll bar. When there are a lot of data the vertical scroll bar is appeared. It is OK. But after that horizontal scroll bar is appeared too. How I can avoid this horizontal scroll bar ?

It is my code:

          <grid height="150px"  hflex="min">
            <columns>
              <column label="one" />
              <column label="two"/>
            </columns>
            <rows>
              <row>
                <label value="Some data"/>
                <label value="Some data"/>
              </row>
              <row>
                <label value="Some data"/>
                <label value="Some data"/>
              </row>
              <row>
                <label value="Some data"/>
                <label value="Some data"/>
              </row>
              <row>
                <label value="Some data"/>
                <label value="Some data"/>
              </row>
            </rows>
          </grid>

Solution

  • If you don't use the native scrollbar your issue is fixed and your data is still all readable :

    <grid height="150px" hflex="min">
        <custom-attributes org.zkoss.zul.nativebar="false"/> 
        <columns>
          <column label="one"/>
          <column label="two"/>
        </columns>
        <rows>
          <row>
            <label value="Some data"/>
            <label value="Some data"/>
          </row>
          <row>
            <label value="Some data"/>
            <label value="Some data"/>
          </row>
          <row>
            <label value="Some data"/>
            <label value="Some data"/>
          </row>
          <row>
            <label value="Some data"/>
            <label value="Some data"/>
          </row>
        </rows>
      </grid>