Skip to content

Added destroy method #1

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

Merged
merged 2 commits into from
Aug 17, 2012
Merged

Added destroy method #1

merged 2 commits into from
Aug 17, 2012

Conversation

kycook
Copy link
Contributor

@kycook kycook commented Aug 17, 2012

I added a destroy method to clean up memory references and event handlers and prevent the plugin from hanging around in memory after the data table is destroyed.

@DataTables
Copy link
Collaborator

This looks excellent - thank you for the pull request.

The only thing I would say, is that the 'destroy' event listener should be bound to DataTables using the _fnCallbackReg method: https://github.com/DataTables/DataTables/blob/master/media/src/core/core.support.js#L217 . That can be accessed via oApi._fnCallbackReg .

There are examples of how it can be used here: https://github.com/DataTables/DataTables/blob/master/media/src/core/core.constructor.js#L130 .

@kycook
Copy link
Contributor Author

kycook commented Aug 17, 2012

Thanks! I added a commit that changes how the destroy event listener is bound.

DataTables pushed a commit that referenced this pull request Aug 17, 2012
@DataTables DataTables merged commit eb583c3 into DataTables:master Aug 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants