cancel
Showing results for 
Search instead for 
Did you mean: 

Scrolling on clicking of Button

ritesh_baheti
Explorer

Hello Expert,

I have Generic Tiles in my application which is bouded to the oData service. Based on the screen size tiles are displayed on the screen. If there are more tiles then I need to add have scroll bar with left and right scroll buttons. Upon clicking on the Right arrow button the tiles present at the right should be displayed and upon clicking on the left arrow button my scroll bar should go to left and left side tiles should be displayed.

Any help would be highly appreciated.

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member620231
Participant
0 Kudos

Hi,

You should put the tiles in a ScrollContainer.

Find a way to see how many tiles are visible (not sure how this would be implemented).

When clicking on an arrow, use scrollToElement method to scroll to the desired tile. There is also the scrollTo method which takes a position, if it better suits you.

Alex

DenisGaland
Participant
0 Kudos

You should use the wrapping attribute of a container like a HBox, so the tiles that exceeds the screen would be rendered under the other tiles, look at an example here, play with the size of the preview and you will see the behaviour.

https://embed.plnkr.co/6CFDXG3fTblsFmSi5CwT/

ritesh_baheti
Explorer
0 Kudos

Hello Expert,

Below is the requirement. When clicked on the Right arrow Button, we should be able to scroll to right and see the tiles present at the right and when clicked on the Left arrow button we should be able to scroll to the left side and see the tiles present at the left

Requesting your expertise suggestion over here.

Thanks and Regards

Ritesh