on 08-02-2019 4:29 AM
Hi,
I am using sap.m.table control and want to freeze table header. how to do it?
Is Fiori not recommending freezing the table header? will it effect mobile view?
Please help
If you are using SAPUI5 1.54 or higher then you can use the property stick="ColumnHeaders" in the Table declaration as below.
Reference - Fixed header for UI5 Smart Table
<code><Table id="table" mode="MultiSelect" sticky="ColumnHeaders,HeaderToolbar">
....
<Table>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are some limitations on the usage of the sticky property for sap.m.Table, please check out description for this property given here - SAPUI5 SDK - sap.m.Table Properties
I am using latest library from https://sapui5.hana.ondemand.com/resources/sap-ui-core.js .
I have tried using the CDN from https://sapui5.hana.ondemand.com/resources/sap-ui-core.js in the bootstrap and I'm able to freeze the table column headers and header toolbar without any issues. Are you developing your app in SAP Web IDE?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using eclipse.
var oTable = new sap.m.Table("idOTable", {
sticky:ColumnHeaders,
inset:true,
growing:true,
});
// Add columns
var col1 = new sap.m.Column("col1FilterSimple",{ popinDisplay:"Block",
hAlign:sap.ui.core.TextAlign.Center,
demandPopin:true,
header: new sap.m.Label({
wrapping:true,
text:"Plant Delivery Date"})});
oTable.addColumn(col1);
var col10 = new sap.m.Column("col10FilterSimple",{
popinDisplay:"Block",
hAlign:sap.ui.core.TextAlign.Center,
demandPopin:true,
minScreenWidth:"Large",
header: new sap.m.Label({wrapping:true,text:"Expected Dispatch Date"})});
oTable.addColumn(col10);
var col2 = new sap.m.Column("col2FilterSimple",{
popinDisplay:"Block",
hAlign:sap.ui.core.TextAlign.Center,
demandPopin:true,
minScreenWidth:"Large",
header: new sap.m.Label({
wrapping:true,
text:"Sale Order No"})});
oTable.addColumn(col2);
var colItems = new sap.m.ColumnListItem("colItemsSimple",{
vAlign:sap.ui.core.VerticalAlign.Middle,
type:"Active"});
oTable.bindAggregation("items","mPeoplea>/materials",colItems);
I have created an app with a sap.m.Table showing data using Eclipse Mars 2 (SAPUI5 1.67.0) along with the sticky=ColumnHeaders property in the table and deployed it to a gateway system having SAPUI5 1.44. I am using index.html (referencing the CDN URL for the SAPUI5 runtime in bootstrap, which you have mentioned earlier) to run the app (not running it via the Fiori launchpad).
When I test the app from the gateway server I see that the table column headers do get freezed when I scroll down in the table. I am really not sure about the exact issue at your end, but I can suggest you to update the SAPUI5 version on your Eclipse if it is running on a version lower than 1.54. Also, ideally if you are going to deploy the app on the gateway server then the app should only use features supported by the SAPUI5 version on the server itself.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
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.