Let's take tab for example:
<script>
dojo.require("dojo.parser" );
dojo.require("dijit.layout.ContentPane" );
dojo.require("dijit.layout.TabContainer" );
</script>
</head>
The two components we need, again, are as follows:
<div dojoType="dijit.layout.ContentPane" title="Personal Data">
<label for="first_name">First Name:</label>
<input type="text" name="first_name" id="first_name" size="30" /><br/>
<label for="last_name">Last Name:</label>
<input type="text" name="last_name" id="last_name" size="30" /><br/>
<label for="middle_initial">Middle Initial:</label>
<input type="text" name="middle_initial" id="middle_initial" size="1" /><br/>
</div>
Then repeat this for all the tabs.
for example:
Phone:</label>
<input type="text" name="work_phone" id="work_phone" size="30" /><br/>
<label for="cell_phone">Cell Phone:</label>
<input type="text" name="cell_phone" id="cell_phone" size="30" /><br/>
</div>
Wrap up these panes in a <div> with dijit.layout.TabContainer:
<div class="formContainer" dojoType="dijit.layout.TabContainer"
style="width:600px;height:600px" >
...
</div>
Notice the height style on the TabContainer. That’s required, and if you
leave it off, the tabs will not appear at all. (Consider yourself warned!)
Something Wrong?
Things happen.
• Make sure your dojoType= attributes are correct. Case matters
here.
• Double-check the <body> tag to make sure it has class="tundra".
<script>
dojo.require("dojo.parser" );
dojo.require("dijit.layout.ContentPane" );
dojo.require("dijit.layout.TabContainer" );
</script>
</head>
The two components we need, again, are as follows:
- A dijit.layout.ContentPane, which holds one "tabful" of data. Each ContentPane has a lable that appears on the tab.
- A dijit.layout.TabContainer, which holds a group of ContentPanes.
<div dojoType="dijit.layout.ContentPane" title="Personal Data">
<label for="first_name">First Name:</label>
<input type="text" name="first_name" id="first_name" size="30" /><br/>
<label for="last_name">Last Name:</label>
<input type="text" name="last_name" id="last_name" size="30" /><br/>
<label for="middle_initial">Middle Initial:</label>
<input type="text" name="middle_initial" id="middle_initial" size="1" /><br/>
</div>
Then repeat this for all the tabs.
for example:
Phone:</label>
<input type="text" name="work_phone" id="work_phone" size="30" /><br/>
<label for="cell_phone">Cell Phone:</label>
<input type="text" name="cell_phone" id="cell_phone" size="30" /><br/>
</div>
Wrap up these panes in a <div> with dijit.layout.TabContainer:
<div class="formContainer" dojoType="dijit.layout.TabContainer"
style="width:600px;height:600px" >
...
</div>
Notice the height style on the TabContainer. That’s required, and if you
leave it off, the tabs will not appear at all. (Consider yourself warned!)
Something Wrong?
Things happen.
• Make sure your dojoType= attributes are correct. Case matters
here.
• Double-check the <body> tag to make sure it has class="tundra".
Comments
Post a Comment