on 08-30-2014 8:19 AM
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.
Dear Sai,
I solved it by work around:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nice Hack Farag!
But, only thing is when you do some column re-ordering this might create a problem. Since, column names and items are not associated each other. However, for people who need for only display and doing some logic on items this should work.
Working sample of your logic - Plunker - MobileTblHdrFixed
Regards,
Sai Vellanki.
HI Sai
IMO, this is a feature that is not easy to implement. I am looking forwards to SAPUI5 to provide this.
-D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dennis,
Thanks for the reply.
Yeah, actually this is not in the requirement provided by patron. But, I was thinking this issue will arise if there are many fields like 10 and many records in the table. Once the user scrolls down, then it will be bit difficult for user to find out which field accumulates which value. That's the only intention I had in my mind.
Any ways, let's see if UI5 team can provide a method in upcoming API. Also, I will try working on the same using JQuery, CSS etc., whatever it takes/requires to get desired output. 🙂
Regards,
Sai.
As I can see the need for desktops (and in the sap.ui.commons.Table it works just like you envisioned), in a mobile environment you certainly don't want this behavior of having table contents scroll inside a page (which can also scroll)
Although I do see your need, since the sap.m.Table is much nicer looking on desktops as well
In the meantime, if you're developing a desktop application, you may want to use the sap.ui.commons.Table instead for this specific use case.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.