PDA

View Full Version : delete toolbar button & add in needed place



Mycoding
29 Jun 2010, 8:48 PM
Please, give me advice how to delete toolbar button dinamicly, and then add button in needed place.
21182



var viewport = new Ext.Viewport({
id:'viewportMain',
layout: "border",
renderTo: Ext.getBody(),
items: [{
id:'north',
region: "north",
xtype: 'panel',
contentEl:'top',
height: 70,
split:true,
collapseMode:'mini',
bbar: [{
id:'toolbarButtonRegister',
text: '???????????',
handler:registration
},'-',{
id:'loginToolbarButton',
text: '????',
handler:login
},'-','->','-',{
"xtype: 'tbbutton',
id:'manageSite',
text:'?????????? ??????',
menu:[{text: '???????? ???????',icon: 'images/table_add.png',cls: 'x-btn-text-icon',handler:addNews}]},'-',{";}
id:'about',
text: '? ?????',
handler: aboutSite
}]
},{
id:'menu',
region: 'west',
xtype: 'panel',
split:true,
width:200,
collapseMode:'mini',
baseCls: 'x-plain',
margins:'5 0 5 5',
items:[{
xtype:'panel',
frame:true,
title:'????',
collapsible:true,
titleCollapse:true,
contentEl:'site'
},{
xtype:'panel',
frame:true,
title:'?????????',
collapsible:true,
titleCollapse:true,
contentEl:'studentSubjects'
},{
xtype:'',
frame:true,
title:'??????????',
collapsible:true,
titleCollapse:true,
contentEl:'schoolSubjects'
}]
},{
id:'center',
region: 'center',
xtype: 'tabpanel',
activeTab: 0,
items: [{
title: '? ?????',
autoScroll: true,
autoLoad:'requests/about.php',
padding:'5 5 0 5'
},{
title: '???????',
xtype: 'grid',
store:store,
stripeRows: true,
columns: [new Ext.grid.RowNumberer({width: 30}),
{header: "???????", dataIndex: 'news',width:700,renderer:news_renderer}
]
}]
},{
region: 'south',
xtype: 'panel',
contentEl:'bottom',
split:true,
collapseMode:'mini',
height: 30
}]
});

Animal
29 Jun 2010, 9:14 PM
Add them both, and then hide()/show()

Mycoding
30 Jun 2010, 8:59 AM
Thaks a lot.