ContextMenu

Do you know why the checkIf function for the context menu is not working correctly for the following code.

isc.Menu.create({
    autoDraw:false,
    width:150,
    data:[{
	     title:"Display", 
	     display:true,        			
	     checkIf:"this.display == true",
             click:function(target,item,menu){this.display=false;}
	    ]
})

The context menu should start out as display being checked. Then after the click the display should not be checked. Thanks.

In the scope of checkIf, “this” is the Menu, not the MenuItem.

Thanks for replying. If I put display instead of this.display, it will give me an error stating that display is undefined. Any guidance? Thanks.

Lots of ways to do it, eg, this.data.get(0) in this case, or, this.data.find(“title”, “Display”).

Thanks a lot.