2012-01-05 19 views
1

一個例子,我有一個刷新按鈕,我創建的顯示在上面,我可以有代碼以後去除這個控制?????在Enyo中,如何刪除您創建的控件?

代碼與它的刷新按鈕,我想刪除以後的程序運行

enyo.kind({ 
    name: "MyApps.MainApp", 
    kind: enyo.VFlexBox, 
    components: [ 

     {name: "gotCommentsSer", kind: "WebService", 
      onSuccess: "gotComments", url: "testservice.json", 
      onFailure: "gotCommentsFailure"}, 
     {name: "getPendingSer", kind: "WebService", 
      onSuccess: "gotPending", url: "testservice.json", 
      onFailure: "gotPendingFailure"}, 

     {kind: "PageHeader", content: "Template"}, 
     {kind: "Button", caption: "Refresh", onclick: "btnRefresh"}, 
     {name:"curValue", content:("Sample Text")}, 
//  {name: "feedUrl", kind: "Input", flex: 1}, 
     {kind: "RichText", name: "PendingMsg", value: "To <b>boldly</b> go..", onchange: "richTextChange"},  
     {kind: "Scroller", flex: 1, components: [ 
      {kind: "VirtualRepeater", name: "list", onSetupRow: "setupRow", components: [ 
       {kind: "Item", layoutKind: "HFlexLayout", components: [ 
         {kind: "HtmlContent", name: "caption2" , onLinkClick: "btnClick"} 
        ]} 
      ]} 
     ]},   
     {kind: "Toolbar", name: "tabs"} 
    ], 

回答

1

這可能是更容易爲你只是.hide()的控制,而不是完全摧毀它。如果你真的想擺脫它,你應該回到動態創建組件的部分。要刪除組件,請嘗試:

this.$.Button.destroy(); 
相關問題