EasyUI Forum
May 16, 2024, 05:35:58 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: about MenuButton question show/hidden  (Read 9117 times)
hjzhbb7758
Jr. Member
**
Posts: 84


View Profile Email
« on: January 16, 2014, 02:25:49 AM »

i have a advanced search in menubutton's panel . when i click the combobox ,the menubutton auto hidden and combobox Z-Index is Less than menubutton Z-Index .
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 16, 2014, 11:59:17 PM »

Please try the code below to fix this issue.
Code:
<script>
$(function(){
$(document).unbind('.combo').unbind('.menu')
.bind('mousedown.combo', handler)
.bind('mousedown.menu', handler);
function handler(e){
var d = $(e.target).closest('span.combo,div.combo-p,div.menu');
if (d.hasClass('combo-p')){
d.find('.combo-f').each(function(){
var p = $(this).combo('panel');
if (p.is(':visible')){
p.panel('close');
}
});
return;
} else if (d.hasClass('combo')){
return;
} else if (d.hasClass('menu')){
return;
} else {
$('body>div.combo-p>div.combo-panel:visible').panel('close');
$('body>div.menu-top:visible').menu('hide');
}
}
});
</script>

The usage example:
Code:
<a href="#" class="easyui-menubutton" data-options="menu:'#mm1'">Search</a>
<div id="mm1" class="menu-content" data-options="hideOnUnhover:false">
<select class="easyui-combobox" data-options="
onShowPanel:function(){
$(this).combobox('panel').panel('panel').css('z-index',$.fn.menu.defaults.zIndex++);
}
">
<option>Item1</option>
<option>Item2</option>
<option>Item3</option>
</select>
</div>
Logged
hjzhbb7758
Jr. Member
**
Posts: 84


View Profile Email
« Reply #2 on: January 19, 2014, 08:18:52 PM »

nice job . It‘s work . thank you.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!