2011-12-01 21 views
1

我有一个自定义对话框,其上有一个按钮和一个输入。在按钮的点击事件上,我想触发输入的OnChange函数。我不知道如何获得当前的兄弟UIElementCKEditor如何执行兄弟UIElement的OnChange

这里是我的代码示例:

{ 
    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() 
     ????? 
    } 
} 

回答

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(); 
     } 
    } 
    ] 
}