robertoroberto
24 Jun 2009, 11:08 PM
Hi
I'm creating a toolbar with an empty item array and after I add buttons manually.
But I see a strange behaviour (I believe it is a bug from my point of view...)
var vToolbar = new Ext.Toolbar(
{
id : mytoolbar',
height : 50,
items : []
});
alert(vToolbar.items.length);
the alert statement returns "1"!!!
I believe it should return 0.
In fact if I add later some buttons (using addButton function), when the toolbar is rendered, I can see an additional first button
Of course it is enough to invoke the removeAll(true) function on the toolbar before add buttons....
Another workaround it to omit the Items:[] in the toolbar construnctor (but in this way sametime ExtJS give an exception becuase std rendering function try to use directly the "items" attribute but this is not initialized and so an exception occurs
Thanks
I'm creating a toolbar with an empty item array and after I add buttons manually.
But I see a strange behaviour (I believe it is a bug from my point of view...)
var vToolbar = new Ext.Toolbar(
{
id : mytoolbar',
height : 50,
items : []
});
alert(vToolbar.items.length);
the alert statement returns "1"!!!
I believe it should return 0.
In fact if I add later some buttons (using addButton function), when the toolbar is rendered, I can see an additional first button
Of course it is enough to invoke the removeAll(true) function on the toolbar before add buttons....
Another workaround it to omit the Items:[] in the toolbar construnctor (but in this way sametime ExtJS give an exception becuase std rendering function try to use directly the "items" attribute but this is not initialized and so an exception occurs
Thanks