Working With Multiple Layouts
Posted: Wed Dec 21, 2016 2:11 am
A problem I have when having multiple layouts is getting the controls/fields in the right layoutitem for the different layouts.
Even though I can toggle the active layout, all the controls still show in the designer and it gets really difficult trying to move controls from one layoutitem into another. So much so, that I pretty much give up on the designer after my first layout then work with other layouts directly in the code. For example, I will often start with one layout such as a desktop or mobile layout, then copy the code for that layout and make a new one adjusting the layoutitems as needed.
Are there any tips or suggestions on how to make working with multiple layouts easier?
For example this is one reusable part that has three layouts (a Main Container, Narrow and Wide)
Once I have the layouts in place, it is easy to toggle between them, its the creating of the Narrow and Wide layouts that is the difficult part.
Even though I can toggle the active layout, all the controls still show in the designer and it gets really difficult trying to move controls from one layoutitem into another. So much so, that I pretty much give up on the designer after my first layout then work with other layouts directly in the code. For example, I will often start with one layout such as a desktop or mobile layout, then copy the code for that layout and make a new one adjusting the layoutitems as needed.
Are there any tips or suggestions on how to make working with multiple layouts easier?
For example this is one reusable part that has three layouts (a Main Container, Narrow and Wide)
Code: Select all
define_com class(#PRIM_TBLO) name(#MainLayout)
define_com class(#PRIM_TBLO.Column) name(#Column1) displayposition(1) parent(#MainLayout)
define_com class(#PRIM_TBLO.Row) name(#Row1) displayposition(1) parent(#MainLayout) height(45) units(Pixels)
define_com class(#PRIM_TBLO.Row) name(#Row2) displayposition(2) parent(#MainLayout)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem1) alignment(TopLeft) column(#Column1) parent(#MainLayout) row(#Row1) sizing(FitToWidth) manage(#MOBTitlePanel) marginleft(5) marginright(5) margintop(5)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem2) alignment(TopLeft) column(#Column1) manage(#ContainerPanel) parent(#MainLayout) row(#Row2) marginleft(5) marginright(5) margintop(5)
define_com class(#PRIM_TBLO) name(#WideLayout)
define_com class(#PRIM_TBLO.Column) name(#Column2) displayposition(1) parent(#WideLayout)
define_com class(#PRIM_TBLO.Column) name(#Column3) displayposition(2) parent(#WideLayout)
define_com class(#PRIM_TBLO.Row) name(#Row3) displayposition(1) parent(#WideLayout)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem3) alignment(TopLeft) column(#Column2) manage(#StatsPanel) parent(#WideLayout) row(#Row3)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem16) alignment(TopLeft) column(#Column3) manage(#ChartPanel) parent(#WideLayout) row(#Row3)
define_com class(#PRIM_TBLO.Item) name(#LayoutItem17) alignment(TopCenter) column(#Column3) manage(#ChartLoadingImage) parent(#WideLayout) row(#Row3) sizing(None) margintop(10)
define_com class(#PRIM_TBLO) name(#NarrowLayout)
define_com class(#PRIM_TBLO.Column) name(#Column4) displayposition(1) parent(#NarrowLayout)
define_com class(#PRIM_TBLO.Row) name(#Row4) displayposition(1) parent(#NarrowLayout) height(176) units(Pixels)
define_com class(#PRIM_TBLO.Item) name(#NarrowLayoutItemStatsLoading) alignment(TopCenter) column(#Column4) parent(#NarrowLayout) row(#Row4) sizing(None) margintop(10)
define_com class(#PRIM_TBLO.Item) name(#NarrowLayoutItemStats) alignment(TopLeft) column(#Column4) parent(#NarrowLayout) row(#Row4) manage(#StatsPanel)
define_com class(#PRIM_TBLO.Row) name(#Row5) displayposition(2) parent(#NarrowLayout)
define_com class(#PRIM_TBLO.Item) name(#NarrowLayoutItemChartLoading) alignment(TopCenter) column(#Column4) row(#Row5) parent(#NarrowLayout) sizing(None) margintop(10)
define_com class(#PRIM_TBLO.Item) name(#NarrowLayoutItemChart) alignment(TopLeft) column(#Column4) parent(#NarrowLayout) row(#Row5) manage(#ChartPanel)