toolbar.items.length
Can I look at it, that in the toolbar there are elements?
Can I delete an element, that it items.length too let him change?
var toolbar = new Ext.Toolbar([
{ text: 1, handler: function() { this.destroy(); alert(toolbar.items.length); } },
{ text: 2, handler: function() { this.destroy(); alert(toolbar.items.length); } },
{ text: 3, handler: function() { this.destroy(); alert(toolbar.items.length); } }
]);
new Ext.Panel({
tbar: toolbar,
renderTo: Ext.getBody()
}); alert(3); alert(3); alert(3); I say thank you for it,
Gabor
I need it only, that is it empty? this was finally:
Ext.override(Ext.Toolbar, {
isEmpty: function() {
return this.tr.childNodes.length == 0;
}
});
toolbar.add(button);
...
toolbar.remove(button);
(autoDestroy is true by default, so the button gets destroyed when removed)
This is not good unfortunately.
I add a button, then doLayout. Okay.
I remove the button. Okay.
DoLayout is newer then. Again there the button.
var button = new Ext.Toolbar.Button({text:'hello'});
var toolbar = new Ext.Toolbar();
new Ext.Panel({
tbar: toolbar,
renderTo: Ext.getBody()
});
alert('.');
toolbar.addButton(button);
if(toolbar.doLayout) toolbar.doLayout();
alert('.');
button.destroy();
alert('.');
if(toolbar.doLayout) toolbar.doLayout();
You could try Animal's Container Toolbar (http://extjs.com/forum/showthread.php?p=124322#post124322) class instead (already part of the Ext 3.0 trunk).
#If you have any other info about this subject , Please add it free.# |

