Home   Single Page

ツリーコントロールへのCreate-on-Open

下の表示のように、onOpenイベントを監視することができます。ツリー項目の子項目を読み込みます。同様にして、グループボックスに対して、creat-on-openができます。

<tree width="200px">
    <treecols>    
        <treecol label="Subject"/>        
        <treecol label="From"/>        
    </treecols>    
    <treechildren>    
        <treeitem open="false" onOpen="load()">        
            <treerow>            
                <treecell label="Intel Snares XML"/>                
                <treecell label="David Needle"/>                
            </treerow>            
            <treechildren/>            
        </treeitem>        
    </treechildren>    
    <zscript>    
    void load() {    
        Treechildren tc = self.getTreechildren();        
        if (tc.getChildren().isEmpty()) {        
            Treeitem ti = new Treeitem();            
            ti.setLabel("New added");            
            ti.setParent(tc);            
        }        
    }    
    </zscript>    
</tree>