jimitary
jimitary

Reputation: 11

How to get the Ext Tree childNodes' id?

I make a Ext tree ,every node contains a checked,every node has a "checkchange" listeners. If I choose a node ,how to make all its childNodes' checked selection to true? And how can I get all child leafNodes' id ?

Upvotes: 0

Views: 649

Answers (2)

Suma
Suma

Reputation: 13

oncheckchange = function(node, checked, options) {
    node.cascadeBy(function(n) {
        alert(n.get('id')); // gives the child node's Id
        n.set('checked', checked);
    });
};

tree.on('checkchange', oncheckchange, null);

Upvotes: 1

Lloyd
Lloyd

Reputation: 29668

In pure Ext you should just be able to do node.id, or node.attributes.id (I forget which) to get the node's ID. In terms of children then it's node.childNodes[*].id etc.

Upvotes: 0

Related Questions