virt2/api/soft/fm/scripts/extjs3-ext/ux.locationbar/Locationbar-component.html

97 lines
2.4 KiB
HTML
Raw Permalink Normal View History

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>LocationBar demo</title>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../../ext-all.js"></script>
<link rel="stylesheet" type="text/css" href="LocationBar.css" />
<script type="text/javascript" src="Ext.ux.LocationBar.js"></script>
</head>
<body>
<script type="text/javascript">
Ext.onReady(function(){
Ext.BLANK_IMAGE_URL = 'http://www.extjs.com/s.gif';
var tree = new Ext.tree.TreePanel({
useArrows:true,
autoScroll:true,
animate:true,
enableDD:true,
containerScroll: true,
region: 'center',
loader: new Ext.tree.TreeLoader({
preloadChildren: true
})
});
// set the root node
var root = new Ext.tree.TreeNode({
text: 'Ext JS',
draggable:false,
id:'source',
expanded: true
});
// generate some child nodes
var node1 = root.appendChild(new Ext.tree.TreeNode({
text: 'Node 1',
draggable:false,
id:'node1'
}));
var node2 = root.appendChild(new Ext.tree.TreeNode({
text: 'Node 2',
draggable:false,
id:'node2'
}));
node2.appendChild(new Ext.tree.TreeNode({
text: 'Node 2-1',
draggable:false,
id:'node2-1'
}));
node2.appendChild(new Ext.tree.TreeNode({
text: 'Node 2-2',
draggable:false,
id:'node2-2'
}));
node2.appendChild(new Ext.tree.TreeNode({
text: 'Node 2-3',
draggable:false,
id:'node2-3'
}));
root.appendChild(new Ext.tree.TreeNode({
text: 'Node 3',
draggable:false,
id:'node3'
}));
tree.setRootNode(root);
// render the tree
//root.expand();
//node2.select();
var locationbar = new Ext.ux.LocationBar({
height: 28,
tree: tree,
region: 'north'
});
var viewport = new Ext.Viewport({
layout: 'border',
items: [
locationbar,
tree
]
});
root.select();
});
</script>
</body>
</html>