Sha256: 0695626764df3ed00819eee036fe6c0a4ce297d0277db00341aee11246109a36

Contents?: true

Size: 1.98 KB

Versions: 4

Compression:

Stored size: 1.98 KB

Contents

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>Dijit Tree Custom Label Test</title>

	<style type="text/css">
		@import "../../../dojo/resources/dojo.css";
		@import "../css/dijitTests.css";
	</style>

	<!-- required: a default dijit theme: -->
	<link id="themeStyles" rel="stylesheet" href="../../../dijit/themes/tundra/tundra.css">
	
	<!-- required: dojo.js -->
	<script type="text/javascript" src="../../../dojo/dojo.js"
		djConfig="parseOnLoad: true, isDebug: true"></script>
	
	<!-- not needed, for testing alternate themes -->
	<script type="text/javascript" src="../_testCommon.js"></script>
	
	<script language="JavaScript" type="text/javascript">
		dojo.require("dijit.dijit"); // optimize: load dijit layer
		dojo.require("dojo.data.ItemFileReadStore");
		dojo.require("dijit.Tree");
		dojo.require("dojo.parser");	// scan page for widgets and instantiate them
	</script>
</head>
<body class="tundra">

	<h1 class="testTitle">Dijit Tree Custom Label Test</h1>

	<div dojoType="dojo.data.ItemFileReadStore" jsId="store"
		url="../_data/states.json"></div>

	<h2>Standard label (state names)</h2>
	<div dojoType="dijit.tree.ForestStoreModel" jsId="nameModel" store="store" rootLabel="States"></div>
	<div dojoType="dijit.Tree" id="nameTree" model="nameModel" openOnClick="true"></div>

	<h2>LabelAttr (state abbreviation)</h2>
	<div dojoType="dijit.tree.ForestStoreModel" jsId="codeModel" store="store" rootLabel="States" labelAttr="abbreviation"></div>
	<div dojoType="dijit.Tree" id="codeTree" model="codeModel" openOnClick="true"></div>

	<h2>Custom label via callback</h2>
	<div dojoType="dijit.tree.ForestStoreModel" jsId="customModel" store="store">
		<script type="dojo/method" event="getLabel" args="item">
			if(item.root){ return "States"; }
			return (store.getLabel(item) + " (" + store.getIdentity(item) + ")");
		</script>
	</div>
	<div dojoType="dijit.Tree" id="customTree" model="customModel" openOnClick="true"></div>


</body>
</html>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dojo-pkg-1.120.0 data/dojo-release-1.2.0-src/dijit/tests/tree/test_CustomLabel.html
dojo-pkg-1.121.0 data/dojo-release-1.2.1-src/dijit/tests/tree/test_CustomLabel.html
dojo-pkg-1.122.0 data/dojo-release-1.2.2-src/dijit/tests/tree/test_CustomLabel.html
dojo-pkg-1.123.0 data/dojo-release-1.2.3-src/dijit/tests/tree/test_CustomLabel.html