SeL
SeL

Reputation: 25

sap.ui.table.Table with visibleRowCountMode="Auto" doesn't adjust its height dynamically in VBox

I tried to fit my sap.ui.table.Table into a sap.f.DynamicPage but the table height won't dynamically resize to the available space in the page content.

I tried to implement the sap.m.VBox with the table attribute visibleRowCountMode="Auto" to fix this problem but the table height is just fixed to the minAutoRowCount parameter of the table.

Screenshot of Table in VBox with minAutoRowCount = 10

Here is the code snippet of the table inside the page content:

<f:content>
  <VBox fitContainer="true">
    <OverflowToolbar>
      <!-- ... -->
    </OverflowToolbar>
    <table:Table visibleRowCountMode="Auto"
      minAutoRowCount="10"
      noData="{i18n>noDataText}"
      width="auto">
      <!-- ... -->
    </table:Table>
  </VBox>
</f:content>

Any suggestions how the height of the table is resized, for example, if the page header is collapsed / expanded?

SAPUI5 Version: 1.60.1

Upvotes: 1

Views: 3135

Answers (1)

Medera
Medera

Reputation: 418

Update: adding FlexItemData growFactor worked for my smarttable.

use property

visibleRowCountMode="Auto"

Update

            <layoutData>
                <FlexItemData growFactor="1" baseSize="0%"/>
            </layoutData>

table:

<Table id="DynamicTableId" selectionMode="MultiToggle" visibleRowCountMode="Auto" minAutoRowCount="10" noData="{i18n>noDataText}"
            fixedColumnCount="1" showColumnVisibilityMenu="true" modelContextChange="onModelContextChange" width="auto">
                <layoutData>
                    <FlexItemData growFactor="1" baseSize="0%"/>
                </layoutData>
</Table>

regards

Upvotes: 2

Related Questions