In ExtJS 3, I was able to designate a leaf as being capable of receiving drag-and-drop appending by setting allowDrop = true.

This worked through the node's allowChildren property, which could be set independently or via allowDrop. The allowChildren property was checked in the relevant places in Ext.tree.TreeDropZone.

In ExtJS 4.1.1, I don't see a way to allow appending to leaves. Have I missed something? Apologies if I have. If not, surely the inability to effectively manipulate which nodes are leaves and which are branches is a bug, particularly when it was so easy in ExtJS 3.

I think this can be easily fixed via the following (or similar) changes to Ext.tree.ViewDropZone. I've marked changed rows with a "change" comment.

PHP Code:
getPosition: function(enode) {
        var 
view this.view,
        
record view.getRecord(node),
        
e.getPageY(),
        
append record.get('allowDrop'), // change
        
noBelow false,
        
region Ext.fly(node).getRegion(),
        
fragment;


    
// If we are dragging on top of the root node of the tree, we always want to append.
    
if (record.isRoot()) {
        return 
'append';
    }


    
// Return 'append' if the node we are dragging on top of is not a leaf else return false.
    
if (this.appendOnly) {
        return 
append 'append' false// change
    
}


    if (!
this.allowParentInsert) {
        
noBelow record.hasChildNodes() && record.isExpanded();
    }


    
fragment = (region.bottom region.top) / (append 2); // change
    
if (>= region.top && < (region.top fragment)) {
        return 
'before';
    }
    else if (!
noBelow && (append !== true || (>= (region.bottom fragment) && <= region.bottom))) { // change
        
return 'after';
    }
    else {
        return 
'append';
    }

If record.get('allowDrop') always returns true or false, I guess you could keep the variable noAppend, set it equal to !record.get('allowDrop'), and ignore the other changes.

Right now (in ExtJS 4.1.1), noAppend is equal to record.isLeaf(). Designating a node as a leaf is, to my mind, indicating that there are no current children, not indicating that there never could be. The developer needs to be able to control separately whether there *may* be children, and the allowDrop config is the natural way to do so.