I created treeview example in angularjs with drag and drop. I want to restrict drag and drop for particular node
Ex:- node 1.2 always be child node need to restrict drop other node on node 1.2 and dynamically remove add button for node 1.2 or disable add button.
My Tree data :
$scope.data = [{
'id': 1,
'title': 'node1',
'nodes': [
{
'id': 11,
'title': 'node1.1',
'nodes': [
{
'id': 111,
'title': 'node1.1.1',
'nodes': []
}
]
},
{
'id': 12,
'title': 'node1.2',
'nodes': []
}
]
}, {
'id': 2,
'title': 'node2',
'nodrop': true, // An arbitrary property to check in custom template for nodrop-enabled
'nodes': [
{
'id': 21,
'title': 'node2.1',
'nodes': []
},
{
'id': 22,
'title': 'node2.2',
'nodes': []
}
]
}, {
'id': 3,
'title': 'node3',
'nodes': [
{
'id': 31,
'title': 'node3.1',
'nodes': []
}
]
}];
}]);