PDA

View Full Version : Disabling drop on root node



zeeshanjeelani
26 Feb 2013, 1:44 AM
Hi I want to disable dropping of node on root of tree node
any idea how to implement??

here is the code


xtype:'treepanel',
height:600,
//store: Ext.getCmp('department').store,
autoScroll:true,
animate:true,
lines:false,
border:false,
dragText:'sdfsdf',
draggable: false,
allowContainerDrops:false,
rootVisible: true,
renderto:Ext.getBody(),
bodyStyle:'padding:5px 5px 0',
viewConfig: {
plugins: {
ptype: 'treeviewdragdrop',

}
},

loadMask:{
msg: 'Loading Data...',
enabled: true
},
id:'mainDeptTreePanel',
cls:'bigTreeStyle',
//height:Ext.get('display_view').getHeight(),
containerScroll: true,
//root:'Department',


store:Ext.create('Ext.data.TreeStore', {


root: {

expanded: true,
draggable: false,


children: [
{text: "homework", id:'home', expanded: true,
draggable: false,

children: [
{ text: "book report",
icon:'./images/department.png',
children:
[
{ text: "alegrbra", leaf: true, dragText:'Algebra'},
{ text: "detention", leaf: true}
]

},
{ text: "book report",
icon:'./images/department.png',
children:
[
{ text: "alegrbra", leaf: true},
{ text: "detention", leaf: true}
]

},

] },

]
},
listeners:{
nodedrop:function(e){
return false;
this.move(e.target,e.dropNode);
},
render:function(cmp){
this.root.on({


});
}

sword-it
26 Feb 2013, 5:37 AM
Hi zeeshanjeelani,

See this thread-
http://www.sencha.com/forum/archive/index.php/t-185703.html?

zeeshanjeelani
26 Feb 2013, 7:10 AM
Thanks for reply can you provide some code example of isValidDropPoint
Because I am using sencha 4x