Ext.require([
'Ext.tree.*',
'Ext.data.*'
])
Ext.onReady(function() {
var store = Ext.create('Ext.data.TreeStore', {
proxy: {
type: 'ajax',
url: 'get-nodes.php',
extraParams: {
isXml: true
},
reader: {
type: 'xml',
root: 'nodes',
record: 'node'
}
},
sorters: [{
property: 'leaf',
direction: 'ASC'
},{
property: 'text',
direction: 'ASC'
}],
root: {
text: 'Ext JS',
id: 'src',
expanded: true
}
})
// create the Tree
var tree = Ext.create('Ext.tree.Panel', {
store: store,
hideHeaders: true,
rootVisible: true,
viewConfig: {
plugins: [{
ptype: 'treeviewdragdrop'
}]
},
height: 350,
width: 400,
title: 'Directory Listing',
renderTo: 'tree-example',
collapsible: true
})
})
1、在引入包的时候是顺序的href="text/,比如国际化没有用/src="javascript"script>/ext/js/.js/.js"
<text/js//>script
type="link rel="<%=path%>
<stylesheet"javascript"。
2、不然会有问题<<
src="<.css"<type="script>text/css"bootstraptext/.js/script
type=".js"js/
src=">css/.js"ext-all
3、最后加上自己的js%=path%>>ExtJs4没有了之前的ext-baseext/、
<script
type="/ext-allext/javascript"%=path%>
<!
>ext/。取代的是bootstrap<ext-lang-zh_CNscript>%=path%>/<