The function can only accept ‘id’ for the argument. but I have to use ‘event’ inside the function.
It works on chrome, but not in firefox. Because we have to pass the ‘event’ variable so any functions related to ‘event’ will work.
// init
var tree = layout.cells('a').attachTree();
// .... load tree items
// attach event
tree.attachEvent('onClick', function(id){
event.stopPropagation(); // <-- not working in firefox
});
The above example shows that an ‘event’ (or sometimes known as ‘e’) variable is used inside the attachEvent function. Firefox give an error ‘event is not defined’, of course.
I need to use that ‘event’ inside the function. Is there any way to do that?