PDA

View Full Version : Error: Cannot set property 'hidden' of null in Ext.panel.Panel.placeholderExpand



NexusOne
28 Dec 2016, 4:24 AM
Hi!

I found this code in Panel.js file



if (center && !floatedPos) {
center.hidden = true;
}


Ext.resumeLayouts(true);
center.hidden = false;
me.el.addCls(floatCls);


Don't know why but you check if center exist, after few lines you assign value to one of center property without checking.
This code exist from ExtJs v4 an cause error in my app

Gary Schlosberg
28 Dec 2016, 6:43 AM
Thanks for letting us know. Are you able to create a test case which reproduces the error you are seeing?
https://fiddle.sencha.com/#view/editor

NexusOne
28 Dec 2016, 7:10 AM
Hey! Thank you for quick replay

https://fiddle.sencha.com/#view/editor&fiddle/1naf

Toggle collapsible panels on bottom right.

Gary Schlosberg
4 Jan 2017, 12:42 PM
All border layouts must have a center region.

http://docs.sencha.com/extjs/4.2.6/#!/api/Ext.layout.container.Border


Any Container using the Border layout must have a child item with region:'center'. The child item in the center region will always be resized to fill the remaining space not used by the other regions in the layout.

NexusOne
4 Jan 2017, 2:15 PM
That's interesting and true. But shouldn't you code to be consistent?
If you check for existence of center var before
Ext.resumeLayouts(true);

Then you need to go in same way after?

It's true for ExtJS v4, v5, v6