You found a bug! We've classified it as
EXTJS-15742
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
-
Binding too late in rendering so not usable to drive 'hidden'
We drive lot of our UI using binding against 'hidden' so to hide or show stuff, sometime we alternative part of the ui depending of the state, so x will show but not y, and alternate.
At startup, initial rendering, everything 'hidden' true via binding shows first, then disappear. That doesn't look good.
This is an example, it's visible but you have to pay attention, maybe we could had extra wait during rendering.
https://fiddle.sencha.com/#fiddle/d7j
-
Not really a bug, but certainly a limitation.
We have a ticket open to look at ways to provide bindings to trigger earlier than render time.
Twitter - @evantrimboli
Former Sencha framework engineer, available for consulting.
As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.
-
The override we use:
Code:
Ext.define('Ext.overrides.Component',{
override:'Ext.Component',
initComponent:function(){
if(this.getBind()){
var keys=Ext.Object.getKeys(this.getBind());
if(Ext.Array.some(
keys,
function(item){
return item==='hidden'||item==='visible';
}
)){
this.hidden=true;
}
}
this.callParent(arguments);
}
});
-
Opened support ticket-21676 for this since it's dragging and I got hit again by this in a new app.
-
Sencha Premium Member
We are facing the same issue right now, but as a workaround we usually just set the hidden config as true by default, then the bind takes effect after the render.
-
This issue keep coming back to the surface. IE8 is showing the popup about killing the long running script because of the repetitive layouts for the many late bindings occurring.
-
Workaround:
Code:
listeners: {
afterrender: function () {
this.lookupViewModel().getScheduler().notify();
}
}
-
A faster and simple override to workaround this.
Code:
Ext.define('Ext.patches.Component', {
override: 'Ext.Component',
compatibility: '6.0.0.640',
initComponent: function () {
if (this.getBind()) {
var keys = Ext.Object.getKeys(this.getBind());
this.hidden = keys.indexOf('hidden') > -1 ? true : (keys.indexOf('visible') > -1 ? true : false);
}
this.callParent(arguments);
}
});
-
Sencha Premium Member

Originally Posted by
wemerson.januario
A faster and simple override to workaround this.
Code:
Ext.define('Ext.patches.Component', {
override: 'Ext.Component',
compatibility: '6.0.0.640',
initComponent: function () {
if (this.getBind()) {
var keys = Ext.Object.getKeys(this.getBind());
this.hidden = keys.indexOf('hidden') > -1 ? true : (keys.indexOf('visible') > -1 ? true : false);
}
this.callParent(arguments);
}
});
I just took this override out, because it was messing up our nested viewmodels. I havent found out the reason yet except from thinking that this.getBind() is taking a bind before it is available which is making it null.
-
21 Jun 2016, 11:46 PM
#10
Sencha Premium Member
A bugfix for this problem would be a great help.