I have a little problem in a huge dojo-based webproject (earlier version than dojo 1.7, as far as I know it is 1.3). I want to trigger a specific event by code but don't know how I could achieve this. It's a event called ondijitclick
which gets registered via the data-dojo-attach-event
-attribute in html. I also can't just call the method which is triggered by this event because I only can access the domnodes (or I just don't know how I could access the objects belonging to this domnodes) at the location where I need this functionality.
I also have code with that I can at least trigger the usual events like "onclick":
if (document.createEventObject){
// IE
var evt = document.createEventObject();
node.fireEvent('onclick', evt);
}
else{
// other browsers
var evt = document.createEvent("HTMLEvents");
evt.initEvent('click', true, true );
node.dispatchEvent(evt);
}
I could enter the ondijitclick
event, but nothing would happen and no errors show up. Visual Studio (with ReSharper) itself tells me that this event cannot be resolved. Because of that I think that no event gets triggered and the commands are just ignored because of unknow event type.
The whole question finally is: Exists a way to trigger such events by code for dojo 1.3 (or genereal for versions before dojo 1.7)?
Edit: clarified that a solution for dojo 1.3 is needed