1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| var tree = new Ext.tree.TreePanel({
root:{text:'Catégorie', id:'Catégorie', expanded:true, children:[{
text:'Child 1'
,data:'Child 1'
,children:[{
text:'Child 1 Subchild 1'
,data:' Child 1 Subchild 1'
,leaf:true
},{
text:'Child 1 Subchild 2'
,data:'Child 1 Subchild 2'
,leaf:true
}]
},{
text:'Child 2'
,leaf:true
,data:'Child 2'
}]}
,loader:new Ext.tree.TreeLoader({preloadChildren:true})
,enableDrag:true
,ddGroup:'t2div'
,region:'west'
,title:'Catégorie'
,layout:'fit'
,width:200
,split:true
,collapsible:false
,autoScroll:true
,listeners:{
startdrag:function() {
var t = Ext.getCmp('target').body.child('div.drop-target');
if(t) {
t.applyStyles({'background-color':'#f0f0f0'});
}
}
,enddrag:function() {
var t = Ext.getCmp('target').body.child('div.drop-target');
if(t) {
t.applyStyles({'background-color':'white'});
}
}
}
}); |
Partager