如图一所示,menubutton 中的 combobox 被遮盖 z-Index 不够。这是作者给出的解决方案
<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>
<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>