wcSplitter - WebCabin/wcDocker GitHub Wiki

Deprecated

This documentation is outdated! See http://docker.api.webcabin.org/wcSplitter.html instead!



wcSplitter API

Version: 2.1.0

The public interface for the panel splitter, separating two halves of the area by a moveable splitter bar.


Contents

Constructor
initLayouts()
docker()
orientation()
minSize()
maxSize()
pos()
pane()
scrollable()
destroy()


new wcSplitter(container, parent, orientation)

Constructs a new splitter to split an area into two halves.

container
Type: DOM Element or JQuery Selector
The DOM element that acts as a container for the splitter. This can either be in the form of a DOM element, a JQuery collection object, or a JQuery string selector.

parent
Type: wcPanel or wcSplitter
A wc widget parent item.

orientation
Type: Boolean
The orientation of the splitter bar. You can use the convenient constants wcDocker.ORIENTATION_HORIZONTAL and wcDocker.ORIENTATION_VERTICAL.


initLayouts()

Initializes the splitter with a wcLayout in each pane.  If you do not use this,
then you will have to create the widgets yourself and add them properly.

docker()

Provides access to the main wcDocker object.

orientation(value)

Gets, or Sets the orientation of the splitter bar.

value
Type: Boolean
If omitted, will only return the current orientation value, otherwise it sets it. You can also use the convenient constants wcDocker.ORIENTATION_HORIZONTAL and wcDocker.ORIENTATION_VERTICAL.


minSize()

Retrieves the minimum size of the entire splitter, based on all elements inside.  

maxSize()

Retrieves the maximum size of the entire splitter, based on all elements inside.  

pos(value)

Gets, or Sets the position of the splitter bar.

value
Type: Number
The desired position (in a percentage value from 0-1) of the splitter bar.


pane(index, item)

Gets, or Sets the element on a given side of the splitter.

index
Type: Number
The index of the pane you want. 0 for left/top and 1 for right/bottom.

item
Type: wc Object
If supplied, assigns a new wc object as the pane.


scrollable(index, x, y)

Gets, or Sets whether a given pane can show scroll bars.

index
Type: Number
The index of the pane you want. 0 for left/top and 1 for right/bottom.

x, y
Type: Boolean
Whether the pane can scroll on either the X or Y direction.


destroy(destroyPanes)

Destroys the splitter.

destroyPanes
Type: Boolean
If true, the panes attached to the splitter will also be destroyed. Use false if you plan to re-use the same wc objects elsewhere.