fiqs8stwme6s806a

welcome to my space

Upon tree node removal the parent folder wrongly takes on file icon

  • This is an issue I am having with the tree.

    I have a context menu that has a delete option, once the node is clicked for deletion it is deleted on the server and once a true response is accepted the folder/file is deleted from the tree. The problem is that when this happens the parent folder claims a leaf icon (file icon) rather than the folder icon it previously possessed. The cls, iconCls attributes are the same, and the leaf attribute of the parent is still undefined. Once node.remove() is called the parent node has the new icon.

    I have tried as you will see below to issue a reload on the parent to try to flush this issue out, but it does not help. Only upon reloading the grandparent of the deleted node does the parent go back to the folder icon.

    Many thanks for any assistance I can get!


    function initiateDeleteNode(node){
    Ext.MessageBox.confirm('Confirm Deletion', 'Do you want to delete: ' + node.attributes.text + '?', function(btn){
    if (btn == 'yes') {
    // Delete Node on server
    url = 'http://url.com';
    if(node.attributes.type == 'file'){
    params = {
    'nodeID': node.attributes.fileID,
    'nodeType': node.attributes.type
    };
    } else if (node.attributes.type == 'folder'){
    params = {
    'nodeID': node.attributes.id,
    'nodeType': node.attributes.type
    };
    }


    var parentNode = node.parentNode;

    Ext.Ajax.request({
    url: url,
    method: 'POST',
    success: function(response, options){
    // forces node to refresh
    if (response.responseText == 'true') {
    fileTreeLoader.load(parentNode);
    node.expand(parentNode);
    }
    else {
    Ext.MessageBox.alert('Delete Failed', 'You do not have permissions to delete this item');
    }
    },
    params: params
    });
    }
    });
    }


  • Same issue here: http://extjs.com/forum/showthread.php?p=156083
    Any news?


  • http://extjs.com/deploy/dev/examples/tree/reorder.html

    If you open up a folder in this example from extjs and then drag out all the child elements the same issue occurs where the parent element wrongly becomes a file leaf.

    For example find the adapter directory, drag out the 5 or so files within it and it changes to a leaf/file

    Any thoughts/help?


  • Well, as I too was looking for this solution and came across several other posts, here is the solution in the FAQ (http://extjs.com/learn/Ext_FAQ#My_tree_node_icons_appear_as_leaf_icons_wh en_in_my_mind_I_know_that_they_may_at_some_time_ha ve_children.) that Animal pointed to in yet ANOTHER post.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Upon tree node removal the parent folder wrongly takes on file icon , Please add it free.
    edit

    Mexico