Portallayout"

From Documentation
Line 83: Line 83:
 
| '''Event:''' <javadoc>org.zkoss.zkmax.ui.event.PortalMoveEvent</javadoc>
 
| '''Event:''' <javadoc>org.zkoss.zkmax.ui.event.PortalMoveEvent</javadoc>
 
Represents an event caused by a portal being moved.
 
Represents an event caused by a portal being moved.
 
+
|-
 +
| <center>onPortalDrop</center>
 +
| '''Event:''' <javadoc>org.zkoss.zkmax.ui.event.PortalDropEvent</javadoc>
 +
Represents an event after a portal being dropped and before a portal being moved. (Since: 9.5.1)
 
|}
 
|}
 
*Inherited Supported Events: [[ZK_Component_Reference/Base_Components/XulElement#Supported_Events | XulElement]]
 
*Inherited Supported Events: [[ZK_Component_Reference/Base_Components/XulElement#Supported_Events | XulElement]]

Revision as of 06:31, 9 November 2020

Portallayout

Employment/Purpose

A portallayout lays out a container which can have multiple columns, and each column might have any number panels placed vertically with different heights. Portallayout allows users to drag-and-drop a panel to change its location.

When using Portallayout, you have to assign the width (either percentage or pixel) to each Portalchildren, or the result might depend on the browser, and not as expected.

Example

ZKComRef Portallayout Example.PNG


    <portallayout height="100%">
        <portalchildren width="50%">
            <panel height="50%" title="Demo">
                <panelchildren>
                    <iframe height="100%" width="100%" src="https://www.zkoss.org/zkdemo"/>
                </panelchildren>
            </panel>
            <panel height="50%" title="Doc">
                <panelchildren>
                    <iframe height="100%" width="100%" src="https://www.zkoss.org/documentation"/>
                </panelchildren>
            </panel>
        </portalchildren>
        <portalchildren width="50%">
            <panel height="100%" title="ZK">
                <panelchildren>
                    <iframe  height="100%" width="100%" src="https://www.zkoss.org/"/>
                </panelchildren>
            </panel>
        </portalchildren>
    </portallayout>

Row-based layout

Since ZK 7.0.0

If you want the portallayout displayed as row-based layout, you can specify the orient property to horizontal.

Default is vertical.

For example,

<portallayout orient="horizontal">
	<portalchildren width="50%">
		<panel height="150px" title="Yahoo">
			<panelchildren>
				<iframe width="100%" src="http://www.yahoo.com/"/>
			</panelchildren>
		</panel>
		<panel height="300px" title="Google">
			<panelchildren>
				<iframe width="100%" src="http://www.google.com/"/>
			</panelchildren>
		</panel>
	</portalchildren>
	<portalchildren width="50%">
		<panel height="150px" title="ZK">
			<panelchildren>
				<iframe width="100%" src="http://www.zkoss.org/"/>
			</panelchildren>
		</panel>
	</portalchildren>
</portallayout>

Supported Events

Name
Event Type
onPortalMove
Event: PortalMoveEvent

Represents an event caused by a portal being moved.

onPortalDrop
Event: PortalDropEvent

Represents an event after a portal being dropped and before a portal being moved. (Since: 9.5.1)

Supported Children

* Portalchildren

Use Cases

Version Description Example Location
     

Version History

Last Update : 2020/11/09


Version Date Content
7.0.0 October, 2013 Portallayout supports row based orientation



Last Update : 2020/11/09

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.