ContentPane
A ContentPane is the most
basic layout tile and it inherits directly from _Widget; conceptually, it is like a
super-duper variation of an iframe
except that it fits right into the page with all sorts of bells and
whistles, not the least of which are the ability to render arbitrary
snippets of HTML (not just full documents), reload content via XHR on
demand, render widgets, and respect the page's theme. More often than
not, a ContentPane is contained
within another widget such as a TabContainer, although a ContentPane has several interesting uses
cases on its own.
In its most generic usage, a layout pane does nothing special at all, as shown in Example 14-1.
Example 14-1. Creating a ContentPane in markup
<html>
<head><title>Fun with ContentPane!</title>
<link rel="stylesheet" type="text/css"
href="http://o.aolcdn.com/dojo/1.1/dojo/resources/dojo.css" />
<link rel="stylesheet" type="text/css"
href="http://o.aolcdn.com/dojo/1.1/dijit/themes/tundra/tundra.css" />
<script
djConfig="parseOnLoad:true",
type="text/javascript"
src="http://o.aolcdn.com/dojo/1.1/dojo/dojo.xd.js">
</script>
<script type="text/javascript">
dojo.require("dijit.layout.ContentPane");
</script>
</head>
<body class="tundra">
<div dojoType="dijit.layout.ContentPane">
Nothing special going on here.
</div>
</body>
</html>Tip
When browsing the source code or reading about Dojo online,
you may notice that there is also a LinkPane dijit. Over the course of time,
ContentPane evolved to absorb
much of what LinkPane ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access