PDA

View Full Version : contextMenu.hide() not working



JohnJones357
2 Jun 2014, 9:12 AM
I have a dataview. In the itemclick handler, I have an IF condition that checks to see if a flag is true. If it is, I want to hide the context menu

itemclickHandler : function(view, rec){
if(rec.data.flag == true){
this.contextMenu.hide();//does not work
this.contextMenu.disable();//works fine
}

thanks

skirtle
2 Jun 2014, 5:21 PM
Try this:


itemclickHandler: function(view, rec) {
if (rec.get('flag')) {
this.contextMenu.hide();//does not work

debugger;

this.contextMenu.disable();//works fine
}
}

Make sure you have the debug tools open in your browser and this should force a breakpoint. My guess is that the menu is being hidden successfully and then re-shown elsewhere. The breakpoint should help you to test my theory.

JohnJones357
6 Jun 2014, 2:01 PM
that was my bad. it was being shown elsewhere. oops