posts - 431,  comments - 344,  trackbacks - 0
jsx3.app.Model.getDescendantsOfType

method getDescendantsOfType(strType, bShallow)

Finds all descendants of the given type.

Parameters:

strType {String | Function | jsx3.lang.Class}the fully-qualified class name, class constructor function, or jsx3.Class instance.
bShallow {boolean}if true, only search direct children, not all descendants.

Returns:

{Array<jsx3.app.Model>}an array of matching descendants

for example:

/**
* Bind change events of the specified control and its all children to the specified callback function.
* exceptedControlNames don't bind change event
*/
Eric.bindChangeEvents = function(rootNode, callback, exceptedControlNames) {
     if (exceptedControlNames == undefined) {
          exceptedControlNames = [];
     }
    // bind change events for TextBox
    var children = rootNode.getDescendantsOfType("jsx3.gui.TextBox");
    for (var i = 0; i < children.length; i++) {
        if (exceptedControlNames.indexOf(children[i].getName()) == -1) {
            children[i].subscribe(jsx3.gui.Interactive.JSXCHANGE, callback);
        }
    }
}

posted on 2007-06-26 10:02 周锐 阅读(268) 评论(0)  编辑  收藏 所属分类: TIBCO

只有注册用户登录后才能发表评论。


网站导航: