logo

/Layout|v2.1.3

Class

new Layout(container, options)layout.jsline 75

Layout class make layout element and include groups, control item move and set events.

PARAMETERS
NameTypeDescription

container

jQueryHTMLElementstring

Wrapper element or id selector

options

object

PROPERTIES
NameTypeDescription

grouplist

array

The list of group options.

PROPERTIES
NameTypeDescription

id

string

The group id

ratio

[ number ]

The group ratio

items

array

The items that the group includes

PROPERTIES
NameTypeDescription

id

string

The item id

contentId

string

The content id

title

string

The item's title

isClose

[ string ]

Whether the item is closed or not

isDraggable

[ string ]

Whether the item is draggable or not

usageStatistics

Boolean = true|false

send hostname to google analytics default value is true

EXAMPLES
var container = document.getElementById('layout');
var Layout = tui.Layout; // or require('tui-layout');
var instance = new Layout(container, {
     grouplist: [{
         id: 'g1',
         ratio: 50,
         items: [{
             id: 'item-lifeStyle',
             contentId: 'lifeStyle',
             title: 'Life Style Seciton',
             isClose: false,
             isDraggable: true
         }, {
             id: 'item-calendar',
             contentId: 'calendar',
             title: 'Calendar Seciton',
             isClose: false,
             isDraggable: true
         }, {
             id: 'item-todoList',
             contentId: 'todoList',
             title: 'TodoList Seciton',
             isClose: false,
             isDraggable: true
        }]
    }, {
         id: 'g2',
         ratio: 50,
         items: [{
             id: 'item-weather',
             contentId: 'weather',
             title: 'Weather Seciton',
             isClose: false,
             isDraggable: true
         }, {
             id: 'item-news',
             contentId: 'news',
             title: 'News Seciton',
             isClose: true,
             isDraggable: true
         }]
    }]
});

Instance Methods

height(height)layout.jsline 272

Save document height or return height

PARAMETERS
NameTypeDescription

height

[ number ]

The height value to save _height feild

RETURNS:
{

number

} - Current height
Resizable