Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an event to listen too after json loaded #38

Open
jcphlux opened this issue Feb 24, 2015 · 3 comments
Open

Added an event to listen too after json loaded #38

jcphlux opened this issue Feb 24, 2015 · 3 comments
Labels

Comments

@jcphlux
Copy link

jcphlux commented Feb 24, 2015

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.
});

@tuupola tuupola added the feature label Mar 2, 2015
@sargue
Copy link

sargue commented Sep 1, 2015

+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.

@sargue
Copy link

sargue commented Sep 18, 2015

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.

@tuupola tuupola changed the title Added an event to listen too after jason loaded Added an event to listen too after json loaded Oct 13, 2015
@psohm
Copy link

psohm commented Apr 4, 2017

that feature should be integrated into the project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants