alfajango / jquery-dynatable

A more-fun, semantic, alternative to datatables
http://www.dynatable.com
Other
2.77k stars 361 forks source link

ajaxComplete and ajaxDone customization #132

Open jasonl99 opened 10 years ago

jasonl99 commented 10 years ago

I needed to have more flexibility with ajaxComplete and ajaxDone. The changes I've made allow you to swap in your own ajaxComplete and ajaxDone functions. In my case, I'm using jquery.when() to require additional data, and then further updating the data returned by the dynatable ajax requested.

Just create a handler for the dynatable:preinit function to swap in your functions.

$('.dynatable').on('dynatable:preinit', function(el, dyna) { dyna.settings.ajax.ajaxSuccess = yourSuccessFunction; return dyna.settings.ajax.ajaxDone = yourDoneFunction; })

Be gentle, javascript is definitely not my strong suit :)

Oxicode commented 10 years ago

+1

drouillard commented 10 years ago

At top of the queue

mlangens commented 8 years ago

Hi @jasonl99! I'm helping @JangoSteve with Dynatable. We're getting ready to move forward with a lot of overdue work. We're having a meeting about all open PRs next week. We do require that all contributors sign the CLA. Are you available to do so?

jasonl99 commented 8 years ago

Sure -- but I ended up not using dynatable (though I still love it as a tool)....I haven't looked at my modifications for a long while. But I will certainly sign whatever you need.

Jason

On Fri, Oct 23, 2015 at 3:08 PM, Max Langensiepen notifications@github.com wrote:

Hi @jasonl99 https://github.com/jasonl99! I'm helping @JangoSteve https://github.com/JangoSteve with Dynatable. We're getting ready to move forward with a lot of overdue work. We're having a meeting about all open PRs next week. We do require that all contributors sign the CLA. Are you available to do so?

— Reply to this email directly or view it on GitHub https://github.com/alfajango/jquery-dynatable/pull/132#issuecomment-150665741 .

mlangens commented 8 years ago

Cool! Here is the link: https://www.clahub.com/agreements/alfajango/jquery-dynatable

JangoSteve commented 8 years ago

This looks great. Very clean code. Just had a couple small suggestions if you'd like to update the pull request, or we can do those as well.