Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

[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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants