javascript - How to destroy a Panel in extjs -


i have border layout in west side have few buttons. on click of buttons few panels show in central panel. here example code of 1 panel display in central panel.

{     xtype: 'mypanel', //  user define panel     itemid: 'mypanel1',     showzoom: false,     showlegends:false,     showslider: false,     showdatagrid: true,     charttype: 'line',     controlpanel:false,     orientation: 'x' } 

now have 1 buton called setting open 1 window. window having checkboxes. in have 1 checkbox called legends. want when click on checkbox legends above panel showlegends : true.when showlegends true create legendpanel , on false want destroy panel.

showlegends:true

 if (me.showlegends) {  legendpanel = ext.create('igo.panel.legendspanel', {      itemid: graphconfig.itemid + 'legends',      graphid: graphconfig.itemid  });  }  cpanel.add(gpanel); 

how can destroy panel when showlegends false.please answering this!!

hope helps, ext.getcmp(id) gives object known id, in case mypanel1

if (me.showlegends) {   legendpanel = ext.create('igo.panel.legendspanel', {   itemid: graphconfig.itemid + 'legends',   graphid: graphconfig.itemid   }); }else{   ext.getcmp("mypanel1").destroy() } 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -