Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Fix element height proportional to screen height

$
0
0

Hello,

 

I am developing a UI5 view using sap.m library components.

 

In my page, I have a flexbox - containing a table and a button below the table.

 

// Table

   var oTab = new sap.m.Table( "oTab", { ....... } );

 

// Layout - Implementing a FlexBox becuase table should be left justified and button should be center justified

  var LayoutParent = new sap.m.FlexBox( "LayoutParent", {

       items: [ oTab,

                   new sap.m.Button({

                                     text: "Back",

                                     icon : "sap-icon://sys-back-2",

                                     press: [oController.handle_back, oController],

                                     layoutData: new sap.m.FlexItemData({alignSelf: sap.m.FlexAlignSelf.Center })

                                   })

              ],

       direction: "Column"

       });

 

 

  // Page  

  var page2 =  new sap.m.Page({

       title: "Report",

   layout: LayoutParent,

   content: [LayoutParent]

  });

 

The number of records in the table oTab is dynamic.

 

With the above code, when the number of elements in the table oTab is more than what can be accomodated in the browser, we have to scroll down to view the button "Back".

 

I want to adjust the view such that the button "Back" is always visible in default browser size (no scrolling to view button) and the table oTab above the button adjusts itself based on browser height (e.g. introduces a scrollbar for table records).

 

Thanks in advance for any suggestions to implement this.

 

Thanks,

Indrajit


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>