How to listen to midgardStorage events?
gkzsolt opened this issue · 1 comments
gkzsolt commented
Hi,
How can I get an instance of the midgardStorage widget instatiated by Create.js? The doc says how to call some public functions on it, but I don't know how to bind to the events listed.
I would like to bind to the 'midgardstoragesaved' event. How can I do that?
Thanks,
gkzsolt commented
I found a way to listen to the "save" event, when save is initiated:
jQuery('body').bind('midgardstoragesave', function (ev, data) {
console.log("storage save event = %o", ev);
});
But unfortunately this does not work for the "saved" event, although this would be the most useful:
jQuery('body').bind('midgardstoragesaved', function (ev, data) {
console.log("storage was saved, event = %o", ev);
});
It was quite hard to believe for me... What I am doing wrong?
(I am initiating by jQuery('body').midgardCreate( )
, although I think you guessed it.)