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

[datatables API] Solution to expose the datatables API if they are not include in the wrapper options #64

Closed
br1anchen opened this issue Aug 27, 2014 · 2 comments

Comments

@br1anchen
Copy link

Hi,

Since this module does not provide all the datatables API, at least as far as I used. Is there any way to expose the datatable jquery object to the angular part code? I did some changes in _renderDataTableAndEmitEvent function

, _renderDataTableAndEmitEvent = function ($elem, options, $scope) {
          var oTable = $elem.DataTable(options);
          $scope.$emit('event:dataTableLoaded', { id: $elem.attr('id'), dt:oTable  });
          return oTable;

Then if there is any angular controller/service observing the event:dataTableLoaded event, it will get oTable datatables jquery object when the datatable is rendered. Then all the datatables API can be used in angular part as well.
The scenario I bring this because I need to use some datatables API according to user interactions. Please let me if there are something missing for me not fully understand how to use datatables API in your current v0.1.0 module

l-lin added a commit that referenced this issue Aug 27, 2014
@l-lin
Copy link
Owner

l-lin commented Aug 27, 2014

Thanks for your suggestion. 👍

@l-lin l-lin closed this as completed Aug 27, 2014
@vincilbishop
Copy link

See this issue here, this is how you can get to the DataTables API: #824

Be sure to drop the () after DataTables contra the datatables.net documentation.

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

No branches or pull requests

3 participants