I would like to create a context driven menu. This menu comes when the user clicks on any of the nodes in the tree. Each node has a class "treedropdownmenu". On node clicked, the context driven menu should open up. I am passing a method "_deleteClick" with the Delete menu option. But it is throwing me an error : "_deleteClick" menu not found.
I have following fine of code in my widget :
$(".treedropdownmenu").live("click", function (event) {
var pos;
if(($(window).height() - event.pageY) < 80) {
pos = {
left: event.pageX + 20,
top: event.pageY - 60
};
} else {
pos = {
left: event.pageX + 20,
top: event.pageY + 20
};
}
if(ko.dataFor(this).nodeId() && ko.dataFor(this).nodeId() !== 0) {
var item = ko.dataFor(this);
var strHtml = "<a href='#' onclick='_deleteClick(item)'>Delete:</a> " + "<br/>" + "<b>Create Date:</b>" + "<br/>" + "<b>Exposed Party Name:</b>" + "<br/>" + "<b>Portfolio Type:</b>" + "<br/>" + "<b>Owner:</b>";
$("#dataManagerMenuItem1234").show().offset(pos).html(strHtml);
}
});
The delete menu I have is :
function _deleteClick(item) {
alert("delete clicked");
}
Can anyone let me know where am I going wrong?