Grid List with Responsive Column Layout
This layout displays a variable number of grid columns depending on available screen size. Grid row's height is dynamically determined by the height of the highest grid element on this row.
Z2UI5_CL_SMPC_APP_222
Controls
sap.f
UI5 1.72
The facts
- Repository
- abap2UI5/samples-controls
- Class
Z2UI5_CL_SMPC_APP_222- Source file
z2ui5_cl_smpc_app_222.clas.abap↗- Library
- sap.f
- UI5 entity
sap.f.GridList- Demo kit sample
sap.f.sample.GridListResponsiveColumnLayout- SAP's own sample
- running at sdk.openui5.org ↗
- Minimum UI5
- 1.72
- In the playground
- runs in the browser, with no system and nothing installed
Keywords: gridlist, grid, list, sap.f, gridlistresponsivecolumnlayout, togglebutton, slider, panel, toolbar, title, responsivecolumnlayout, gridlistitem
Controls it builds
- sap.f.GridList
- sap.f.GridListItem
- sap.m.Label
- sap.m.Panel
- sap.m.Slider
- sap.m.Title
- sap.m.ToggleButton
- sap.m.Toolbar
- sap.m.VBox
- sap.ui.core.mvc.View
- sap.ui.layout.cssgrid.ResponsiveColumnItemLayoutData
- sap.ui.layout.cssgrid.ResponsiveColumnLayout
Read out of the builder chain by the abap2UI5 linter, not from the category this sample is filed under — which is what makes “which samples build one of these” a question the catalogue can answer at all.
Libraries
Run it here
The sample running, in this page — the app on its own, with no editor over it.
Switch to Playground with this code
Nothing is installed and nothing is sent anywhere: the ABAP is compiled to JavaScript in this browser and runs against abap2UI5 itself.
The ABAP
z2ui5_cl_smpc_app_222.clas.abap — 199 lines
Click a number to link to a line — shift-click for a range.
Read it on GitHub ↗
" @keywords gridlist grid list sap.f gridlistresponsivecolumnlayout togglebutton slider panel toolbar title responsivecolumnlayout gridlistitem
" @summary This layout displays a variable number of grid columns depending on available screen size. Grid row's height is dynamically determined by the height of the highest grid element on this row.
CLASS z2ui5_cl_smpc_app_222 DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES z2ui5_if_app.
DATA slider_value TYPE i VALUE 100.
PROTECTED SECTION.
DATA client TYPE REF TO z2ui5_if_client.
METHODS view_display.
PRIVATE SECTION.
ENDCLASS.
CLASS z2ui5_cl_smpc_app_222 IMPLEMENTATION.
METHOD z2ui5_if_app~main.
me->client = client.
IF client->check_on_navigated( ).
view_display( ).
ENDIF.
ENDMETHOD.
METHOD view_display.
DATA(view) = z2ui5_cl_ui5_view_builder=>factory( ).
view->ele( n = `View` ns = `mvc`
)->a( n = `xmlns` v = `sap.m`
)->a( n = `xmlns:mvc` v = `sap.ui.core.mvc`
)->a( n = `xmlns:grid` v = `sap.ui.layout.cssgrid`
)->a( n = `xmlns:f` v = `sap.f`
)->tag( `ToggleButton`
)->a( n = `id` v = `revealGrid`
)->a( n = `text` v = `Reveal Grid`
)->a( n = `class` v = `sapUiSmallMargin`
" onSliderMoved sets the width of byId('panelForGridList') - the Panel HAS
" a width property, so the resize is a roundtrip-free binding pair (the
" app-176/213 idiom) instead of a jQuery write
)->tag( `Slider`
)->a( n = `value` v = client->_bind( slider_value )
)->ele( `Panel`
)->a( n = `id` v = `panelForGridList`
)->a( n = `width` v = |\{= ${ client->_bind( slider_value ) } + '%' \}|
)->a( n = `backgroundDesign` v = `Transparent`
)->ele( `headerToolbar`
)->ele( `Toolbar`
)->a( n = `height` v = `3rem`
)->tag( `Title`
)->a( n = `text` v = `GridList with ResponsiveColumnLayout`
)->end(
)->end(
)->ele( n = `GridList` ns = `f`
)->a( n = `id` v = `grid1`
)->ele( n = `customLayout` ns = `f`
)->tag( n = `ResponsiveColumnLayout` ns = `grid`
)->end(
)->ele( n = `GridListItem` ns = `f`
)->ele( n = `layoutData` ns = `f`
)->tag( n = `ResponsiveColumnItemLayoutData` ns = `grid`
)->a( n = `columns` v = `4`
)->a( n = `rows` v = `4`
)->end(
)->ele( `VBox`
)->a( n = `class` v = `sapUiSmallMargin`
)->tag( `Title`
)->a( n = `text` v = `4 / 4`
)->a( n = `wrapping` v = `true`
)->tag( `Label`
)->a( n = `text` v = `Subtitle`
)->a( n = `wrapping` v = `true`
)->end(
)->end(
)->ele( n = `GridListItem` ns = `f`
)->ele( n = `layoutData` ns = `f`
)->tag( n = `ResponsiveColumnItemLayoutData` ns = `grid`
)->a( n = `columns` v = `3`
)->a( n = `rows` v = `2`
)->end(
)->ele( `VBox`
)->a( n = `class` v = `sapUiSmallMargin`
)->tag( `Title`
)->a( n = `text` v = `3 / 2`
)->a( n = `wrapping` v = `true`
)->tag( `Label`
)->a( n = `text` v = `Subtitle`
)->a( n = `wrapping` v = `true`
)->tag( `Label`
)->a( n = `text` v = `Subtitle`
)->a( n = `wrapping` v = `true`
)->tag( `Label`
)->a( n = `text` v = `Subtitle`
)->a( n = `wrapping` v = `true`
)->end(
)->end(
)->ele( n = `GridListItem` ns = `f`
)->ele( n = `layoutData` ns = `f`
)->tag( n = `ResponsiveColumnItemLayoutData` ns = `grid`
)->a( n = `columns` v = `3`
)->a( n = `rows` v = `2`
)->end(
)->ele( `VBox`
)->a( n = `class` v = `sapUiSmallMargin`
)->tag( `Title`
)->a( n = `text` v = `3 / 2`
)->a( n = `wrapping` v = `true`
)->tag( `Label`
)->a( n = `text` v = `Subtitle`
)->a( n = `wrapping` v = `true`
)->tag( `Label`
)->a( n = `text` v = `Subtitle`
)->a( n = `wrapping` v = `true`
)->tag( `Label`
)->a( n = `text` v = `Subtitle`
)->a( n = `wrapping` v = `true`
)->end(
)->end(
)->ele( n = `GridListItem` ns = `f`
)->ele( n = `layoutData` ns = `f`
)->tag( n = `ResponsiveColumnItemLayoutData` ns = `grid`
)->a( n = `columns` v = `1`
)->a( n = `rows` v = `1`
)->end(
)->ele( `VBox`
)->a( n = `class` v = `sapUiSmallMargin`
)->tag( `Title`
)->a( n = `text` v = `1 / 1`
)->a( n = `wrapping` v = `true`
)->tag( `Label`
)->a( n = `text` v = `Subtitle`
)->a( n = `wrapping` v = `true`
)->end(
)->end(
)->ele( n = `GridListItem` ns = `f`
)->ele( n = `layoutData` ns = `f`
)->tag( n = `ResponsiveColumnItemLayoutData` ns = `grid`
)->a( n = `columns` v = `1`
)->a( n = `rows` v = `1`
)->end(
)->ele( `VBox`
)->a( n = `class` v = `sapUiSmallMargin`
)->tag( `Title`
)->a( n = `text` v = `1 / 1`
)->a( n = `wrapping` v = `true`
)->tag( `Label`
)->a( n = `text` v = `Subtitle`
)->a( n = `wrapping` v = `true`
)->tag( `Label`
)->a( n = `text` v = `Subtitle`
)->a( n = `wrapping` v = `true`
)->tag( `Label`
)->a( n = `text` v = `Subtitle`
)->a( n = `wrapping` v = `true`
)->tag( `Label`
)->a( n = `text` v = `Subtitle`
)->a( n = `wrapping` v = `true`
)->tag( `Label`
)->a( n = `text` v = `Subtitle`
)->a( n = `wrapping` v = `true`
)->end(
)->end(
)->end(
)->end( ).
client->view_display( view->stringify( ) ).
ENDMETHOD.
ENDCLASS.
More in sap.f
- Semantic Page using Draft Indicator — This sample demonstrates the use of a DraftIndicator in the footer area.
- Grid Container — This sample represents the general usage of GridContainer.
- Dynamic Page Freestyle Example — Dynamic Page freestyle example with a responsive sap.m.Table in the content area, showing…
- Grid List features - Grouping, Header, Growing — This sample illustrates subgroups with headers, custom header and lazy loading of GridLis…
- Grid List - Break point examples - S, M, L, XL — This sample illustrates how to configure the responsive settings for different container…
- Shell Bar with search — Shell Bar example with configured search functionality.
- Flexible Column Layout (with Event Bus) — Clicking on a link in a column opens the next column.
- Dynamic Page with Sticky Subheader — Dynamic Page containing an sap.m.IconTabBar in the sticky subheader content area.
- Dynamic Page with Responsive Avatar — Dynamic Page demonstrating the breakpointChange event to adjust Avatar sizes responsively…
- Flexible Column Layout Landmark Info For Columns — Flexible Column Layout where the first and the last columns have custom Landmark Info
- Flexible Column Layout Landmark Info For Arrows — Flexible Column Layout where the all the arrows have custom Landmark Info
- Grid Container - Drag and Drop — This sample represents GridContainer with enabled Drag and Drop functionality.
On this page