Login Register Help
API Documentation
Choose a stylesheet:

Constructordijit.layout.ContentPane

dojo.require("dijit.layout.ContentPane");
defined in dijit/layout/ContentPane.js

A widget that can be used as a standalone widget or as a baseclass for other widgets Handles replacement of document fragment using either external uri or javascript generated markup or DOM content, instantiating widgets within that content. Don’t confuse it with an iframe, it only needs/wants document fragments. It’s useful as a child of LayoutContainer, SplitContainer, or TabContainer. But note that those classes can contain any widget as a child.

Usage

var foo=new dijit.layout.ContentPane(params: Object?, srcNodeRef: DomNode|String);
parametertypedescription
paramsObjectOptional.
srcNodeRefDomNode|String 

Examples

Example 1

Some quick samples: To change the innerHTML use .attr(‘content’, ‘new content’)

Or you can send it a NodeList, .attr(‘content’, dojo.query(‘div [class=selected]’, userSelection)) please note that the nodes in NodeList will copied, not moved

To do a ajax update use .attr(‘href’, url)

Jump to PropertiesJump to FunctionsConstructorsBack to top

Destroy all the widgets inside the ContentPane and empty containerNode
Destroy the ContentPane and its contents
[Re]download contents of href and display
See dijit.layout._LayoutWidget.resize for description. Although ContentPane doesn't extend _LayoutWidget, it does implement the same API.
Test if we have exactly one visible widget as a child, and if so assume that we are a container for that widget, and should propogate startup() and resize() calls to it. Skips over things like data stores since they aren't visible.
Returns true if the content is currently shown
Since I am a Container widget, each of my children expects me to call resize() or layout() on them.
This is called whenever new content is being loaded
This is called whenever the content is being unloaded
Call resize() on each of my child layout widgets, either now (if I'm currently visible) or when I become visible
Insert the content into the container node
Hook to make attr("content", ...) work. Replaces old content with data content, include style classes from old content
Hook so attr("href", ...) works.

Jump to PropertiesJump to ConstructorsFunctionsBack to top

Functionattr(name: String|Object, value: Object?)
Defined by dijit._Widget
Set or get properties on a widget instance.
Overrides
Cancels an in-flight download of content
Functionconnect(obj: Object|null, event: String|Function, method: String|Function)
Defined by dijit._Widget
Connects specified obj/event to specified method of this object and registers for disconnect() on widget destroy.
Functiondestroy(preserveDom: Boolean)
Defined by dijit._Widget
Destroy this widget, but not its descendants. Will, however, destroy internal widgets such as those used within a template.
Defined by dijit._Widget
Recursively destroy the children of this widget and their descendants.
FunctiondestroyRecursive(preserveDom: Boolean?)
Defined by dijit._Widget
Destroy this widget and it's descendants. This is the generic "destructor" function that all widget users should call to cleanly discard with a widget. Once a widget is destroyed, it's removed from the manager object.
FunctiondestroyRendering(preserveDom: Boolean?)
Defined by dijit._Widget
Destroys the DOM nodes associated with this widget
Functiondisconnect(handles: Object)
Defined by dijit._Widget
Disconnects handle created by this.connect. Also removes handle from this widget's list of connects
Defined by dijit._Widget
Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode. Does not return nested widgets, nor widgets that are part of this widget's template.
Defined by dijit._Widget
Returns all the widgets that contained by this, i.e., all widgets underneath this.containerNode. This method should generally be avoided as it returns widgets declared in templates, which are supposed to be internal/hidden, but it's left here for back-compat reasons.
Defined by dijit._Widget
Return true if this widget can currently be focused and false if not
Defined by dijit._Widget
Checks the page for text direction
Defined by dijit._Widget
Called when the widget stops being "active" because focus moved to something outside of it, or the user clicked somewhere outside of it, or the widget was hidden.
FunctiononClick(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of mouse click events.
Defined by dijit._Widget
Callback if someone tries to close the child, child will be closed if func returns true
Overrides
Called on DOM faults, require faults etc. in content. In order to display an error message in the pane, return the error message from this method, as an HTML string. By default (if this method is not overriden), it returns nothing, so the error message is just printed to the console.
FunctiononDblClick(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of mouse double click events.
Overrides
Called when download is finished.
Overrides
Called when download error occurs. In order to display an error message in the pane, return the error message from this method, as an HTML string. Default behavior (if this method is not overriden) is to display the error message inside the pane.
Overrides
Called before download starts.
Defined by dijit._Widget
Called when the widget becomes "active" because it or a widget inside of it either has focus, or has recently been clicked.
Defined by dijit._Widget
Called when another widget becomes the selected pane in a dijit.layout.TabContainer, dijit.layout.StackContainer, dijit.layout.AccordionContainer, etc. Also called to indicate hide of a dijit.Dialog, dijit.TooltipDialog, or dijit.TitlePane.
FunctiononKeyDown(event: key)
Defined by dijit._Widget
Connect to this function to receive notifications of keys being pressed down.
FunctiononKeyPress(event: key)
Defined by dijit._Widget
Connect to this function to receive notifications of printable keys being typed.
FunctiononKeyUp(event: key)
Defined by dijit._Widget
Connect to this function to receive notifications of keys being released.
FunctiononLoad(data)
Overrides
Event hook, is called after everything is loaded and widgetified
FunctiononMouseDown(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of when the mouse button is pressed down.
FunctiononMouseEnter(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of when the mouse moves onto this widget.
FunctiononMouseLeave(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of when the mouse moves off of this widget.
FunctiononMouseMove(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
FunctiononMouseOut(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
FunctiononMouseOver(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
FunctiononMouseUp(event: mouse)
Defined by dijit._Widget
Connect to this function to receive notifications of when the mouse button is released.
Defined by dijit._Widget
Called when this widget becomes the selected pane in a dijit.layout.TabContainer, dijit.layout.StackContainer, dijit.layout.AccordionContainer, etc. Also called to indicate display of a dijit.Dialog, dijit.TooltipDialog, or dijit.TitlePane.
Overrides
Event hook, is called before old content is cleared
FunctionplaceAt(reference: String|DomNode|_Widget, position: String|Integer?)
Defined by dijit._Widget
Place this widget's domNode reference somewhere in the DOM based on standard dojo.place conventions, or passing a Widget reference that contains and addChild member.
Defined by dijit._Widget
Called after a widget's dom has been setup
Defined by dijit._Widget
Called after the parameters to the widget have been read-in, but before the widget template is instantiated. Especially useful to set properties that are referenced in the widget template.
FunctionsetAttribute(attr: String, value: anything)
Defined by dijit._Widget
Deprecated. Use attr() instead.
FunctionsetContent(data: String|DomNode|Nodelist)
Overrides
Deprecated. Use attr('content', ...) instead.
FunctionsetHref(href: String|Uri)
Overrides
Deprecated. Use attr('href', ...) instead.
Overrides
See dijit.layout._LayoutWidget.startup for description. Although ContentPane doesn't extend _LayoutWidget, it does implement the same API.
Defined by dijit._Widget
Returns a string that represents the widget. When a widget is cast to a string, this method will be used to generate the output. Currently, it does not implement any sort of reversable serialization.
Overrides dijit._Widget,
Stub function. Override to implement custom widget tear-down behavior.
Defined by dijit._Widget
Step during widget creation to copy all widget attributes to the DOM as per attributeMap and _setXXXAttr functions.
Function_attrToDom(attr: String, value: String)
Defined by dijit._Widget
Reflect a widget attribute (title, tabIndex, duration etc.) to the widget DOM, as specified in attributeMap.
Overrides
Hook to make attr("content") work
Overrides
Call this to load href contents if necessary.
Defined by dijit._Widget
This is where widgets do processing for when they stop being active, such as changing CSS classes. See onBlur() for more details.
Defined by dijit._Widget
Called when someone connects to one of my handlers. "Turn on" that handler if it isn't active yet. This is also called for every single initialization parameter so need to do nothing for parameters like "id".
Function_onError(type, err, consoleText)
Overrides
Defined by dijit._Widget
This is where widgets do processing for when they are active, such as changing CSS classes. See onFocus() for more details.
Overrides dijit._Widget,
Called when the ContentPane is made visible

Jump to FunctionsJump to ConstructorsPropertiesBack to top

Overrides
Defined by dijit._Widget
Overrides
Defined by dijit._Widget
Overrides
Overrides
Overrides
Defined by dijit._Widget
Overrides
Defined by dijit._Widget
Overrides
Overrides
Overrides
Defined by dijit._Widget
Overrides
Overrides
Overrides
Overrides
Overrides
Defined by dijit._Widget
Defined by dijit._Widget