With args.originalEvent.stopPropagation()
the menu does’nt refresh.
I found a solution but the menu makes a step to right?
Here is my solution:
menu = new DayPilot.Menu({
items: [
{
text: 'test',
icon: 'far fa-square',
onClick: function (args) {
args.originalEvent.stopPropagation();
var isChecked = args.item.icon == 'far fa-check-square';
args.item.icon = isChecked ? 'far fa-square' : 'far fa-check-square';
menu.show(args.source);
}
}
],
onShow: function(args) {
...
}
});