I have the code to show the context menu and I would like to add a Class on the items of context menu as I do with IDs
that.add({ id: sourceItem.id + index, value: $(item).attr('title'), href: $(item).attr('href') });
webix.ui({
view:"contextmenu",
id: container + "_menu",
width: 200,
on:{
onBeforeShow:function(){
var context = this.getContext();
var grid = context.obj;
var itemId = context.id;
var sourceItem = grid.getItem(itemId);
// Get the <a href> elements as array from actions column of the clicked row
var links = $(sourceItem.actions).toArray();
that = this;
this.clearAll();
$.each(links, function(index, item){
// Add them in the context
that.add({ id: sourceItem.id + index, value: $(item).attr('title'), href: $(item).attr('href') });
// If has disabled class then disable this menu
if ( $(item).hasClass('disabled') || $(item).attr('disabled') ) {
that.addCss( sourceItem.id + index, "disabled" );
}
});
}
}
}).attachTo( grid[gridId] );