PDA

View Full Version : [FIXED-279]doComponentLayout and doLayout do nothing after removeDocked or setHeight



djkraz
10 Sep 2010, 2:31 PM
I am trying to create something very similar to what happens when you click in the "What's on your mind?" textbox on facebooks newsfeed page. For anyone that's not familiar with it, I want to have an omnipresent toolbar with a single line textbox in it that when focused on will expand to 2 lines and provide ancillary options.

I tried a bunch of things but no matter what I do, after calling removeDocked or setHeight on docked panel, doComponentLayout doesn't do anything (no errors either). With removedDocked I end up with white space where the panel was and with setHeight, the panel changes size but the non docked panels or docked toolbars below the item get covered up. Is this a bug or do I need to call a different routine?

Here is a stripped down runnable example:

Ext.setup({
fullscreen: true,
icon: 'icon.png',
glossOnIcon: false,
onReady: function() {


var toolbar = new Ext.Toolbar({
dock: 'top',
title: 'Test',
centered: true,
items: [
{
text: 'removeDocked',
handler: function() {
panel.removeDocked(form, false);
panel.doComponentLayout();
}
}, {
text: 'setHeight',
handler: function() {
form.setHeight(80);
panel.doComponentLayout();
}
}
]
});

var form = new Ext.form.FormPanel({
dock: 'top',
items: [
{
xtype: 'textfield',
name: 'status',
placeHolder: 'What\'s on your mind?'
}
]
});

var panel = new Ext.Panel({
dockedItems: [form, toolbar],
fullscreen: true,
items: [{ html: 'test<br />test 2<br />test3'}]
});

}

});

djkraz
12 Sep 2010, 2:57 PM
Has anyone seen this issue before and/or know of a workaround?

blessan
12 Sep 2010, 8:05 PM
I think doComponentLayout is broken

djkraz
12 Sep 2010, 8:22 PM
I managed to make it work with the following:



[parent-panel].getDockedItems()[0].rendered = false;
[parent-panel].doComponentLayout();


This seems to work every time. Now if I can just get an answer about why xml attribute mappings aren't working I'd be one happy man!

evant
12 Sep 2010, 9:38 PM
Something doesn't look quite right here. Moving this over to bugs.

blessan
14 Sep 2010, 9:17 PM
What is the status of this bug? Is there any work around?

TommyMaintz
15 Sep 2010, 4:11 AM
This has been fixed for 0.96. Layouts are now aware when of any sizing of a child item, or the removal of a child item and will take that into account in the next doComponentLayout run.

djkraz
15 Sep 2010, 1:45 PM
Thanks! I can't get over how responsive you guys are!

Jamie Avins
16 Sep 2010, 10:12 AM
We have added doComponentLayout to the removeDock method so you shouldn't need it there. In addition, setting the height of the component should bubble the layout to the ownerCt so the doComponentLayout is no longer necessary either.

mbalsam
15 Aug 2011, 1:33 AM
Has this actually been fixed? Whenever I remove a docked component from a panel with a card layout the active card is not shown anymore. doComponentLayout is called but does not seem to work correctly in this case.

I am using Sencha Touch 1.1.0.

losingrose
4 Dec 2011, 10:18 PM
1. Add a list to the panel with the method 'items.add'.
2. make 'panel.doComponentLayout()'.
3. the value of 'panel.getHeight()' also equal to old height not changed.

I use the Sencha Touch 1.1