using each in contextmenu

I wish to show/hide options in a context menu
when I use showItem/HideItem the order value in the object gets cleared after the first use and the each operation fails, if I use enableItem/disableItem the function performs as expected.
I also looked at using parse to create new data on the fly for the context menu from json text strings.

This is a snippet of the enable/disable version.
Any help on this would be appreciated.
Regards
Clive

     		webix.ui({
				view:"contextmenu",
				id:"context_1",
				name:"context_1",				
				data:[
				    {id:"link",value:"New Link"},
				    {id:"family",value:"New Family"},
				    {id:"person",value:"New Person"}
				    ],
				on:{
					onItemClick:function(id){
						webix.message(this.getItem(id).value);
					}
				}
			});    
			
			
  var  context_options='link,family';
  
  
  $$("tb_new").attachEvent("onItemClick", function (id){

        $$("context_1").data.each(function (obj){
            var id=obj.id;
            if(context_options.search(id)>-1){
               $$("context_1").enableItem(id);
                }else{
                $$("context_1").disableItem(id);
           }
         });
       $$("context_1").show();
 });

onItemClick is related to the inner list. Menu as a special event onMenuItemClick that handles disabled items.

As menu contains the list, the only way to hide/show item is to use the data filtering

I’ve modified a sample from one of the related topics, perhaps this way to attach the context menu will be helpful:

http://webix.com/snippet/66b81292

I have now modified my application to use filtering as suggested and it works fine.
Thanks