Skip to Content
avatar image
Former Member

How to align sap.m.Table using scroll container with header fixed ?

I have 1 table for header which is fixed and below that i have another table for rows in which i am using scroll container. I want to know how to make alignment of header columns with rows when i add new rows to my table.

kindly find below xml view:

<Table showNoData='false' id="ID_TBL_HD_NEW">

<columns>

<Column>

<header> <Text text="{i18n>leadId}" /> </header>

</Column>

<Column>

<header> <Text text="{i18n>description}" /> </header>

</Column>

<Column>

<header> <Text text='CompanyCode' /> </header>

</Column>

<Column>

<header> <Text text='ContactPerson' /> </header>

</Column>

</columns>

</Table>

<ScrollContainer vertical='true' id="ID_SCROLL_NEW" horizontal="true">

<Table items="{Model>/results}" id="ID_TBL_SCROLL_NEW" itemPress="onPressRow"> <columns>

<Column>

</Column>

<Column>

</Column>

<Column>

</Column>

<Column>

</Column>

</columns>

<items>

<ColumnListItem type="Navigation">

<Link text="{Model>LeadID}" press="navToLeadDetails" />

<Text text="{Model>Description}" />

<Link text="{Model>CompanyCode}" press="onPressCompanyId" />

<Link text="{Model>ContactPerson}" press="onPresscontactPerson" /> </ColumnListItem>

</items>

</Table>

</ScrollContainer>

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Nov 27, 2017 at 09:59 AM

    Hi Toshif,

    The alignment is not proper because you have used list type="Navigation" so it added ">" icon at the end. Other than type navigation use type="Active". Hope this will resolve your issue.

    And also you will face the same issue when the scroll comes in the list in that case you can one more empty coloumn at the end of first list empty text and set its width equal to scrollbar width.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 27, 2017 at 08:37 AM

    Hi,

    You're getting any error? Please share screenshots.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 27, 2017 at 09:22 AM

    I am not getting any error. All i want is to align my header table columns to the item table columns respectively.

    In the above image, you can easily point out my question of alignment.

    The first column (LeadID) is aligned properly, in the same way i want all the columns to be aligned (respectively).

    Kindly help,

    Thanks

    Add comment
    10|10000 characters needed characters exceeded