EasyUI Forum

General Category => General Discussion => Topic started by: iceh on December 28, 2013, 04:14:37 AM



Title: feature request for menu
Post by: iceh on December 28, 2013, 04:14:37 AM
Hi,

I have a feature request for menus.

I't like to have a "visibility" property for a Menu Item
and a 'setVisible' method.

Thx.


Title: Re: feature request for menu
Post by: stworthy on December 28, 2013, 06:39:05 PM
It is easy to extend these methods.
Code:
<script>
$.extend($.fn.menu.methods,{
showItem:function(jq, itemEl){
return jq.each(function(){
$(itemEl).show();
});
},
hideItem:function(jq, itemEl){
return jq.each(function(){
$(itemEl).hide();
});
}
});
</script>

Find a menu item with 'text' and hide it.
Code:
var m = $('#mm');
var item = m.menu('findItem', 'Save');
m.menu('hideItem',item.target);


Title: Re: feature request for menu
Post by: iceh on January 03, 2014, 07:15:56 AM
Thanks a lot!