jquery_chained
jquery_chained copied to clipboard
Added an event to listen too after json loaded
I added a trigger to the getJSON so I could listen to the event.
Changes - request = $.getJSON(settings.url, data, function(json) { build.call(self, json); /* Force updating the children. */ $(self).trigger("change"); $(self).trigger("dataLoaded", [self]); });
Usage - $("target_select").on("dataLoaded", function (e) { //do stuff. });
+1
I also need this but the event name should be namespaced to avoid collisions with other libraries. Maybe the event should be named load.chained.remote
.
Will try to prepare a PR.
Well, I've forked the project, made the change, created a test and... works ok with jQuery, fails miserably with Zepto.
Seems that the problem is on the event name.
If I use load.chained.remote
as the event name it works only with jQuery.
If i use customloadevent
as the event name it works everywhere.
I am far from being an expert, so googling about this I found a related article with helpful comments. I'm sending the PR with the event named as chaned:load
but suggestions are very welcome.
that feature should be integrated into the project