PDA

View Full Version : remove item from toolbar



Stephan123
20 Aug 2009, 2:29 AM
Hello !

Sorry it's to heat in germany. (:|
I have a simple question.
In my project is a toolbar with same buttons.
I will remove a button from the toolbar.


var tool = Ext.getCmp('toolbar');
tool.items[1].remove();

tool.doLayout();dont work.

Greetings Stephan

Animal
20 Aug 2009, 2:31 AM
Read your code.

Compare it to the docs.

Stephan123
20 Aug 2009, 4:47 AM
Hi !

I have the problem solved





// My toolbar
tool = Ext.getCmp('toolbar');

// the items of the toolbar
var teile = tool.items;

// remove the items
teile.each(function(item,index,length){
tool.remove(item);
});

// make new items
for(var i=0;i < antwort.buttonname.length;i++){
button(antwort.buttonname[i],antwort.schaltung[i]);
}


Stephan

Animal
20 Aug 2009, 5:30 AM
So you really REALLY don't like to read documentation then?