cancel
Showing results for 
Search instead for 
Did you mean: 

Scroll in sap.m.Table or sap.m.Panel

Former Member
0 Kudos

Hi, I'm trying to put a scroll bar in a sap.m.Table or sap.m.Panel. I tried with sap.m.ScrollContainer and inside of this the Table, but the scroll bar is never showed.

how can i do that?

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

former_member220538
Active Participant
0 Kudos

Hi Jose,

Add table as content to the scroll container. Make sure that the contents of the table is greater than the scroll container.


Refer this link

http://jsbin.com/tosuq/2/edit

Regards,

Jeffin

Former Member
0 Kudos

It works but if you put a fixed height when the screen is small does not work properly.

former_member182862
Active Contributor
0 Kudos

HI Jose

what about this?

Example

-D

Former Member
0 Kudos

Thanks it's works fine!!. I solved this setting scroll bar in the Page, but I'll try to use this option. Thanks!!!

Answers (2)

Answers (2)

0 Kudos

This message was moderated.

former_member9607
Active Participant
0 Kudos

Can you pls paste your code here.

Also try to set height and width 100% for scrollcontainer.

Regards,

kk

Former Member
0 Kudos

This is de code //Product Panel var pnlScrollProduct = new sap.m.ScrollContainer({horizontal:true});  var pnlProduct = new sap.m.Panel("idProductPanel");  var searchBar=new sap.m.Toolbar("searchbar", { content:[ new sap.m.SearchField("searchfield", { placeholder: "Search a product", search: [oController.onSearch, oController] }), new sap.m.Button("cart", { icon: "sap-icon://cart" }) ] }); var productTable = new sap.m.Table(this.createId("orderItems"), { visible: false,         headerToolbar : new sap.m.Toolbar({             content : [ new sap.m.Label({                 text : "Order Items"             })]         })     }); pnlScrollProduct.addContent(productTable); pnlProduct.addContent(searchBar); pnlProduct.addContent(pnlScrollProduct); Page.addContent(pnlProduct);

former_member9607
Active Participant
0 Kudos

Hi Jose,

You have placed content in wrong place holder.

Please place your content in this hierarchy. 

Scroll Container---> Inside Scroll Container : Panel ---> Inside Panel : Search, Table

please check the link JS BIN

Regards,

KK

Former Member
0 Kudos

I tried with this place holder but the scroll bar is never showed. pnlProduct.addContent(searchBar); pnlProduct.addContent(productTable); pnlProduct.addContent(btnDisplayOrder); pnlScrollProduct.addContent(pnlProduct); With the the Other place holder and setting height on the scrollcontainer the scrollbar is showed but is not a good solution for me. pnlScrollProduct.addContent(productTable); pnlProduct.addContent(searchBar); pnlProduct.addContent(pnlScrollProduct);