87,910
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<title>Extjs 布局</title>
<!--引用Extjs4.0类库开始-->
<script type="text/javascript" charset="gb-2312" src="../extjs/bootstrap.js"></script>
<link href="../extjs/resources/css/ext-all.css" rel="Stylesheet" />
<!--引用Extjs4.0类库结束-->
</head>
<script type="text/javascript">
Ext.require([
'Ext.tree.*',
'Ext.data.*',
'Ext.tip.*'
]);
Ext.QuickTips.init();
Ext.onReady(function () {
var store = Ext.create('Ext.data.TreeStore', {
proxy: {
type: 'ajax',
url: 'json_tree_dept.aspx',
root:'items'
},
root: {
text: '部门',
id: 'root',
expanded: true
},
folderSort: true,
sorters: [{
property: 'text',
direction: 'ASC'
}]
});
var tree = Ext.create('Ext.tree.Panel', {
id: 'tree',
store: store,
width: 250,
height: 300,
viewConfig: {
plugins: {
ptype: 'treeviewdragdrop',
appendOnly: true
}
},
renderTo: document.body
});
});
</script>
<body>
</body>
</html>