cancel
Showing results for 
Search instead for 
Did you mean: 

Gridlayout menue (3 columns) center on the screen

hs1
Participant
0 Kudos

Hi all here,

ist there any way to bring a gridlayout (menue) with 3 columns center to screen? I want fixed width for a menue-gridlayout and allways center

APPLICATION.alert(gridlayout.getWidth()+"");

Error and Value -1 becouse it's on "auto"

APPLICATION.alert(gridlayout.getLeftMargin()+"");

gridlayout.setLeftMargin((maximized-object.getWidth()-gridlayout.getWidth())/2);

APPLICATION.alert(gridlayout.getLeftMargin()+"");

any idea?

br Harry

Accepted Solutions (1)

Accepted Solutions (1)

IngoH
Active Contributor
0 Kudos

not 100% sure if I fully got what you trying to do.

so you want a grid layout component with three columns. and it is supposed to be centered ?

Ingo

hs1
Participant
0 Kudos

Hi Ingo,

yes, you understood it correctly.

gridlayout (Menue) allways Center!

thx when you have any idea harry

IngoH
Active Contributor
0 Kudos

just to be "rock solid" here.

We are talking about the Grid Layout component.

and you would like to center it using script or already in the design ?

what is not working when setting the width to "auto" ?

Ingo

Former Member
0 Kudos

What are you doing with the alerts, in combination with the grid? I fail to see the connection between your code and the grid layout item..

Sjoerd

hs1
Participant
0 Kudos

Ingo,

when one object center you need left and right "auto" but Design Studio allowed one auto.

When width = auto then by wide screen looks not beautiful menue width must be fixed

so I wanted the left value and the right value are together and divide by 2, and the left value set

but read the right value it's error bcouse it's auto

br harry

hs1
Participant
0 Kudos

Hi Sjoerd,

the alert show's me the value.

There is now breakpoint in the script so i use alert to control the value

br harry

IngoH
Active Contributor
0 Kudos

perhaps its me and I am missing something here.

you mentioned you are using a grid layout with three columns (not rows).

correct, if you set the width to "auto" - it will auto scale. that is the idea.

but wouldn't be when using a grid layout with three columns all with the same width, meaning equally split, the middle column be in the center ?

Ingo

hs1
Participant
0 Kudos

Hi Inge i draw two screens the red has for screen 1 and screen 2 center and not left but the width is fixed

br harry

IngoH
Active Contributor
0 Kudos

Hi Harold,

I don't think that is possible with only Design Studio right now. you basically trying to do a complete auto size / repositioning based on the screen size.

So the left side is fixed and the width is fixed, which makes the "right" part the "auto" part. Problem is that it is "auto" in way of staying away from the right hand side.

Did you think about perhaps having a few lines of codes "around" the design studio app or using global variables and calling the design studio via the URL, hand over information about the "screen resolution" and then depending on the size to have perhaps have the one or the other grid visible ?

In your example if the screen size would become so small that the table width is bigger than the screen size, then the fixed width will be used.

Ingo

hs1
Participant
0 Kudos

Hi Ingo,

yes i think about via URl!

"Did you think about perhaps having a few lines of codes "around" the design studio app or using global variables and calling the design studio via the URL, hand over information about the "screen resolution" and then depending on the size to have perhaps have the one or the other grid visible ?"

This is a way but not a good way. Now ist this the only way to center the object.

We look forward to the next version 1.2

thx Harry

Answers (0)