EasyUI Forum
April 29, 2024, 05:26:20 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: sub menu not fire onShow  (Read 880 times)
MSAG
Newbie
*
Posts: 41



View Profile Email
« on: April 04, 2023, 06:22:54 AM »

Hi
i want to relocate sub menu because it get out of screen border
onShow not work on sub menu


<div id="mm" class="easyui-menu" data-options="onShow:menuHandler1" style="width:120px;">
    <div>New</div>
    <div>
        <span>Open</span>
        <div data-options="onShow:menuHandler2" style="width:150px;">
            <div><b>Word</b></div>
            <div>Excel</div>
            <div>PowerPoint</div>
        </div>
    </div>
    <div data-options="iconCls:'icon-save'">Save</div>
    <div class="menu-sep"></div>
    <div>Exit</div>
</div>

<script type="text/javascript">
   function menuHandler1(){
      alert('1');
   }
   function menuHandler2(){
      alert('2');
   }
</script>
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: April 05, 2023, 07:38:38 PM »

The 'onShow' event fires only when the top menu displays. If you want to change the default position of the menu, please try to set the 'position' function for the menu.
Code:
$('#mm').menu({
position: function(target,left,top){
return {left:left,top:top}
}
})
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!