EasyUI Forum
September 14, 2025, 04:42:08 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: dynamically created splitbutton and subitems  (Read 11833 times)
tmark
Newbie
*
Posts: 7


View Profile
« on: September 24, 2012, 09:44:50 AM »

How can I create dynamically splitbuttons?

From the doc.:
<a href="javascript:void(0)" id="sb" onclick="javascript:alert('ok')>Ok</a> 
<div id="mm" style="width:100px;"> 
... 
</div>

$('#sb').splitbutton({ 
    iconCls: 'icon-ok', 
    menu: '#mm' 
});

Ok, and how can I insert new items (id, title, icon) in the menu part of #sb?

Thanks, Mark
Logged
anton.dutov
Newbie
*
Posts: 27


View Profile
« Reply #1 on: September 24, 2012, 06:34:00 PM »

Something like that
Code:
$('#mm').menu('appendItem', {
text: 'New Item',
iconCls: 'icon-ok',
onclick: function(){alert('New Item')}
});
Logged
tmark
Newbie
*
Posts: 7


View Profile
« Reply #2 on: September 25, 2012, 01:20:20 AM »

Unfortunatelly it does not work for me.
It generates a new menu item, but not in the menulist, it will be a menuheader. Sad


Thanks, it works!

Mark
« Last Edit: September 25, 2012, 04:38:07 AM by tmark » 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!