EasyUI Forum

General Category => Bug Report => Topic started by: mzeddd on April 10, 2014, 03:24:21 AM



Title: 1.3.6 menu: There is no panel size update after menu option hide/show
Post by: mzeddd on April 10, 2014, 03:24:21 AM
Lets have menu like this

Code:
<div id="myMenu" style="width:150px;">
  <div onclick="">Menu1</div>
  <div onclick="">Menu2</div>
  <div onclick="">Menu3</div>
  <div onclick="">Menu4</div>
  <div onclick="">Menu5</div>
</div>

It has 5 menu options.

If I call

Code:
$($('#myMenu').menu('findItem','Menu1').target).hide();
Menu1 should disapper and menu itself should be resized to fit 4 options instead of 5.

In 1.3.6 I see this kind of resize in not called and menu appears with empty space at the end of menu.
In 1.3.5 this problem is not visible.

See attached picture


Title: Re: 1.3.6 menu: There is no panel size update after menu option hide/show
Post by: stworthy on April 10, 2014, 07:40:27 AM
Please download the patch file from http://www.jeasyui.com/download/downloads/jquery-easyui-1.3.6-patch.zip.

To hide a menu item, please call 'hideItem' method instead.
Code:
var m = $('#myMenu');
var item = m.menu('findItem', 'Menu1');
m.menu('hideItem', item.target);


Title: Re: 1.3.6 menu: There is no panel size update after menu option hide/show
Post by: mzeddd on April 10, 2014, 09:03:29 AM
This patch fixes my problem. Thanks.

But I wonder why this happend.
In my code I used example of code advised by you some time ago.