Reputation: 1443
I have textfield:
{
xtype: 'textfield',
fieldLabel: 'LBL_EMAIL',
anchor: '100%',
listeners: {
'render': function(p) {
// check certain conditions
this.hide()
}
},
},
"hide()" only hides textbox (without label) and I want hide whole row (textbox and label). Any ideas?
Upvotes: 7
Views: 15777
Reputation: 152
In Sencha Architect (v4.3.0.108 and extJS v7.4.0.45), you can add a Render Event Binding and then inside this write:
component.hide();
This will hide the field and its label.
But thanks for your answers. They pointed me in the right direction.
Upvotes: 0
Reputation: 484
Use something like:
yourElement.container.up('div.x-form-item').hide();
Upvotes: 0
Reputation: 3941
I had to do following to make it work.
{
xtype: 'textfield',
anchor: '100%',
listeners: {
'render': function(p) {
// hide label
Ext.getCmp('cluster_name').getEl().up('.x-form-item').setDisplayed(false);
}
},
},
Upvotes: 2
Reputation: 21
Maciej's answer didn't work more me. Putting this in Ext's defaults did:
Ext.layout.FormLayout.prototype.trackLabels = true;
Upvotes: 2
Reputation: 1443
I found a solution, I have to configure the FormLayout with:
trackLabels: true
Upvotes: 8