Consider the random class below.
I want to render its child items depending on some condition.
For that in beforerender I return false based on the condition.
Container class renderer
I want to render its child items depending on some condition.
For that in beforerender I return false based on the condition.
But, if the beforerender function returns false, complete container is not rendered.
(i.e. Other item (Text2) is not rendered)
Ext.define('ClassA',
{
extend : "Ext.container.Container",
xtype: 'a1', // TabPanel itself has no title
itemId: 'a1',
border : false,
arialRole : 'region',
// First tab active by default
layout :
{
type :'vbox',
},
items:[
{
xtype: 'button',
text : 'Text',
itemId : 'btNotifyBar',
listeners:
{
beforerender : function(a, optws)
{
// Some Condition
if(app.globals.data.get(1)==1)
return true;
else
return false;
}
}
},
{
xtype: 'button',
text : 'Text2',
itemId : 'item2'
}
]
});
Container class renderer
Aucun commentaire:
Enregistrer un commentaire