How to append child to a container component

Members

(constant) Using AppendChild to add a button to a layoutinfobox

Note: In version 1.1.0 and earlier, the "appendChild" function does not take effect in "onMounted" event of Tcomponents.

Example
// Suppose there is a LayoutInfobox named LayoutInfobox_9 in the workspace.
// Create a Button instance, append it to LayoutinfoBox_9
const btn = new TComponents.Button(null,{
    left:20,
    top:40,
    position:'absolute'
})

Instance.LayoutInfobox_9.appendChild(btn,'button1')

// Remove the appended instance
Instance.LayoutInfobox_9.removeChild('button1')

(constant) 使用AppendChild向layoutinfobox添加按钮

注意在: 1.1.0 版本之前, appendChild 函数不会在 onMounted 下生效

Example
// 假设工作区中有一个名为LayoutInfobox_9的容器
// 创建一个Button实例,将其添加到LayoutinfoBox_9

const btn = new TComponents.Button(null,{
    left:20,
    top:40,
    position:'absolute'
})
Instance.LayoutInfobox_9.appendChild(btn,'button1')

// 删除刚才添加的实例
Instance.LayoutInfobox_9.removeChild('button1')