Skip to Content

sap.m.Table: Fixed header with scrollable content

Dear UI5 experts,


Can anyone suggest how to have a fixed thead (header) with scrollable table cells (content) on sap.m.table control ?


I tried using CSS property - position: fixed for .thead class, but it is getting cluttered also header and cells are being mismatched.


Thank you for your help in advance!


Regards,

Sai.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Sep 16, 2015 at 01:00 AM

    Dear Sai,

    I solved it by work around:

    1. draw table with only header
    2. scroll container containing table with hidden header and the same columns of the first table.


    This is code sample:

    <Table showNoData="false">

    <columns>

    <Column minScreenWidth="" demandPopin="false">

    <Text text="{i18n>ContractID}" />

    </Column>

    <Column minScreenWidth="Tablet" demandPopin="true">

    <Text text="{i18n>ContractType}" />

    </Column>

    <Column minScreenWidth="Tablet" demandPopin="true">

    <Text text="{i18n>CompanyCode}" />

    </Column>

    </columns>

    </Table>

    <ScrollContainer
    horizontal="true"
    vertical="true"
    focusable="true"
    >

    <Table
    select="handleSelectionChange"
    itemPress="handleItemPress"
    growing="true"
    growingThreshold="100"
    growingScrollToLoad="true">

    <columns>

    <Column minScreenWidth="" demandPopin="false">

    </Column>

    <Column minScreenWidth="Tablet" demandPopin="true">

    </Column>

    <Column minScreenWidth="Tablet" demandPopin="true">
    </Column>

    </columns>

    </Table>

    </ScrollContainer>

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      But I guess when we have to use fixed layout table and the table has a lot of column this solution won't work. Cause I tried it now and I can scroll second table and see other columns but the header of first table seems fixed. I can't see other the header of other columns.

  • Posted on Aug 31, 2014 at 06:31 PM

    HI Sai

    IMO, this is a feature that is not easy to implement. I am looking forwards to SAPUI5 to provide this.

    -D

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.