EasyUI Forum
May 17, 2024, 06:57:42 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [SOLVED] menuButton add items  (Read 3734 times)
jega
Full Member
***
Posts: 191


View Profile
« on: October 26, 2018, 02:03:23 AM »

Hi

Need to add more items to a menu after loading the page.

<div id="menuList" class="easyui-panel menuBox" style="width:100%;padding:5px">
     <a id="pub" href="javascript:void(0)" class="easyui-menubutton" data-options="menu:'#menu_docs',iconCls:'icon-documents',plain:true">Documents</a>
</div>

<div id="menu_docs" class="easyui-menu">
     <div onclick="window.open('doc_default.pdf','_blank')">Default document</div>
</div>

Getting a filelist from server folder

$.each(filesData, function(index, element){
   var dataTag = '<div onclick="window.open('+element.filename+')"></div>';
   $('#menu_docs').append(dataTag);
});

But can't see it in the menu

Any help ??

Regards
Jesper
« Last Edit: October 27, 2018, 01:33:14 AM by jega » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 26, 2018, 06:55:09 PM »

Please call 'appendItem' method to append menu items. Please refer to this documentation https://www.jeasyui.com/documentation/menu.php
Logged
jega
Full Member
***
Posts: 191


View Profile
« Reply #2 on: October 27, 2018, 01:32:53 AM »

Why didn't i see that.  Smiley

Thanks
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!