PDA

View Full Version : Portal example



oklymenko
24 Jan 2012, 10:34 AM
I would love to move to 4.1 as soon as possible but I would not be able to do it without the portal example working.

Does anybody know when it's going to be available?

Thanks,
Alex.

mitchellsimoens
24 Jan 2012, 11:01 AM
The portal example is in 4.1.0 beta 1

oklymenko
24 Jan 2012, 11:17 AM
Thanks!

I must have missed it. I tried it in my project and it did not work out of the box. I guess I assumed it has not been converted yet. I will give it another try.

Thanks again!

oklymenko
24 Jan 2012, 1:50 PM
It appears that the problem occurs when you put the portal inside a form panel:



Ext.onReady(function () {
Ext.create('Ext.FormPanel', {
renderTo: 'portal-test',
title: 'Portal Test',
margin: 20,
width: 600,
height: 400,
layout: 'fit',

items:
[
{
xtype: 'portalpanel',
region: 'center',
items:
[
{
items:
[
{
title: 'Portlet 1',
height: 100
},
{
title: 'Portlet 2',
height: 100
}
]
}
]
}
]
});
});


The error is thrown here:


getDockedItems : function(selector, beforeBody) {
var dockedItems = this.getComponentLayout().getDockedItems('render', beforeBody);
...
}


this.getComponentLayout returns the 'body' layout which does not have the getDockedItems method.

If you change FormPanel to Panel, everything is fine.

I would appreciate if somebody could look into it.

Thanks,
Alex.

oklymenko
27 Jan 2012, 10:00 AM
I am getting the same error in 4.1.0-beta-2.

I was able to mitigate it by using the following override (not sure if it's correct, but it worked for me):


Ext.override(Ext.app.PortalPanel, {
getDockedItems: function (selector, beforeBody) {
var layout = this.getComponentLayout();
if (layout.getDockedItems) {
var dockedItems = layout.getDockedItems('render', beforeBody);
if (selector && dockedItems.length) {
dockedItems = Ext.ComponentQuery.query(selector, dockedItems);
}
return dockedItems;
}
else {
return [];
}
}
});

Do I have to report it through a separate post using the "How to report a bug" template, or is this sufficient? Just don't want to create duplicates.

Thanks,
Alex.

nbourdeau
24 Feb 2012, 9:52 AM
I am getting the same error in 4.1.0-beta-2.

I was able to mitigate it by using the following override (not sure if it's correct, but it worked for me):


Ext.override(Ext.app.PortalPanel, {
getDockedItems: function (selector, beforeBody) {
var layout = this.getComponentLayout();
if (layout.getDockedItems) {
var dockedItems = layout.getDockedItems('render', beforeBody);
if (selector && dockedItems.length) {
dockedItems = Ext.ComponentQuery.query(selector, dockedItems);
}
return dockedItems;
}
else {
return [];
}
}
});

Do I have to report it through a separate post using the "How to report a bug" template, or is this sufficient? Just don't want to create duplicates.

Thanks,
Alex.

I have the same error in 4.1 B1 & B2 but in other contexts. Is this bug reported elsewhere ??

oklymenko
24 Feb 2012, 9:54 AM
Yes, I reported it here (http://www.sencha.com/forum/showthread.php?181284)