I use
$('#test').unbind('click');
to remove the click event on the #test item. How do I make the item clickable again?
Actually I have a table. On click event a context menu appears. But if there are no entries the menu has to be disabled. So I use unbind above. Since the context menu is generated by a plugin I do not know how to make it clickable again.
Any ideas?
Update: this is how the context menu is set up
$('#contacts tbody tr').contextMenu('myMenu1', {
bindings: {
'sms': function(t) {},
'delete': function(t) {}
}
});
Since I am still not sure how to solve my problem I will describe it a little more. I use the lightweight context-menu plugin in jQuery to display context menus.
#contacts tbody tr
are the table rows and myMenu1
is the context menu that appears on tr click.
On my page I have a table. Each row has its own context menu, well always the same but function(t)
referes always to the clicked row.
Well, the table may be empty so I want to disable the context menu. I believe there are may ways to do that. One is to unbind the click event, this does not work for me.
I hope anyone has an idea.