我有一个带有按钮和输入的自定义对话框。在按钮的单击事件上,我想触发输入的OnChange
功能。我不知道如何获得当前的兄弟姐妹UIElement
。
以下是我的代码示例:
{
id : 'txtUrl',
type : 'text',
label : 'My input',
onChange : function() {
alert('content changed')
}
}
{
type : 'button',
align : 'center',
label : 'My Button',
onClick : function() {
// execute the input.onChange()
?????
}
}
答案 0 :(得分:1)
我发现(另一位开发者向我展示),然后回答:
{
id : 'info',
label : 'my container',
elements :
[
{
id : 'txtUrl',
type : 'text',
label : 'My input',
onChange : function() {
alert('content changed')
}
}
{
type : 'button',
align : 'center',
label : 'My Button',
onClick : function() {
this.getDialog().getContentElement("info", "txtUrl").onChange();
}
}
]
}