PDA

View Full Version : [FIXED][3.x] Updating a menu post show()



stever
8 May 2009, 7:31 PM
http://extjs.com/forum/showthread.php?p=327520

After looking through the code, it looks like the menu layout was designed to support this, and the add part of a menu calls the layout.doAutoSize. It just isn't working though...

Animal
8 May 2009, 11:43 PM
It's a bug caused by the height trimming imposed by the default true setting of enableScrolling.

Set it to false, and it works a bit better.

doLayout needs to sync the shadow though:



new Ext.Window({
height: 150,
width: 400,
tbar: [{
text: 'Test Menu',
menu: {
enableScrolling: false,
items: {
itemId: 'loading',
icon:'http://extjs.com/deploy/ext-3.0-rc1.1/resources/images/default/grid/loading.gif',
text: 'Loading'
},
listeners: {
show: function(){
if (!this.loadingDone) {
this.remove('loading');
this.add({
text: 'test'
});
this.add({
text: 'test'
});
this.add({
text: 'test'
});
this.add({
text: 'test'
});
this.add({
text: 'test'
});
this.loadingDone = true;
this.doLayout();
this.el.sync();
}
},
delay: 500
}
}

}]

stever
9 May 2009, 10:40 AM
Hmm, nice catch. Though in my case, I really need the scrolling ability! It does give me some idea where to look though...

Animal
9 May 2009, 1:03 PM
If I were you I'd just put a Somebody Else's Problem Field around this for a while until Evan or Tommy fixes it!

stever
9 May 2009, 4:19 PM
If I were you I'd just put a Somebody Else's Problem Field around this for a while until Evan or Tommy fixes it!

Yeah, 'above my pay grade' comes to mind... ;)

stever
12 May 2009, 8:47 AM
(Help please)

:">

evant
12 May 2009, 9:22 AM
Try the latest in SVN.

stever
12 May 2009, 2:59 PM
Awesome, thanks!

stever
14 May 2009, 3:13 PM
Just curious why that isn't the doLayout itself? When I create a menu with the auto layout option off, add a bunch of stuff, and then instead of calling doLayout, I need to call onItemChange?

BTW: Thanks for the changes, it would have taken me a while to get versed on menu internals to figure it out on my own...