Custom Layout

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
HGRobert
New User
Posts: 10
Joined: Mon Mar 27, 2017 8:03 am
First Name: Robert
Last Name: Eggert
Company Name: H. Gautzsch
Contact:

Custom Layout

Post by HGRobert »

I'm very grateful that 5.8 allows us to create a Custom Layout, this offers the possiblility of responsive design with corporate identity within seconds!
I do have questions though, is there something like "propertySetters" (as in pui.widget.add) to execute a piece of JavaScript when a layout property value was changed?

Thanks,

Robert
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Custom Layout

Post by Scott Klement »

There isn't something like propertySetters -- that is for when you create a widget. In this case, you are using an existing (Layout) widget.

But, it is possible for JavaScript code to run when the template is evaluated. Take a look at the options for "JavaScript expression variables" documented here:
http://www.profoundlogic.com/docs/pages ... d=31260909
HGRobert
New User
Posts: 10
Joined: Mon Mar 27, 2017 8:03 am
First Name: Robert
Last Name: Eggert
Company Name: H. Gautzsch
Contact:

Re: Custom Layout

Post by HGRobert »

I developed my CustomLayout after reading the documentation for "pui.retrieveCustomLayoutTemplate( name )"
This is really a great new feature, but I got stuck...

"Properties can potentially be bound to host variables" - How? -> my new properties don't have this option
I also found (when I made a mistake in coding) that the property category can be add... - How to do this properly?

In my new Panel layout there are header sections (like a window control box) that execute a script. In this script I'd like to set a host variable for the specific function...
HGRobert
New User
Posts: 10
Joined: Mon Mar 27, 2017 8:03 am
First Name: Robert
Last Name: Eggert
Company Name: H. Gautzsch
Contact:

Re: Custom Layout

Post by HGRobert »

In a CustomLayoutTemplate I do have the following part:

<div class="content"><div repeat="{ property: 'Number of Divs', help: 'Text, text, text...' }" class="tab" container="true">......-X-......</div></div>

At ......-X-...... I'd like to add an array item, i.e. a paragraph to fill the corresponding div.
How can I access that particular item? In other words, is there somthing like an index variable when using "repeat"?

Any help is greatly appreciated,

Robert
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Custom Layout

Post by Scott Klement »

Sorry, there isn't any way to use an array for this.
HGRobert
New User
Posts: 10
Joined: Mon Mar 27, 2017 8:03 am
First Name: Robert
Last Name: Eggert
Company Name: H. Gautzsch
Contact:

Re: Custom Layout

Post by HGRobert »

Thanks for the quick answer Scott.

I just can't let off... Is there a way to use containers in custom widgets?
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Custom Layout

Post by Scott Klement »

If you mean "custom layouts", yes... you should be able to use containers.

If you mean other types of widgets, then no... only a layout can be a container.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], grtgatsby, harrisonje and 3 guests