5

I'm trying to implement a simple custom search on a column. This is well documented at https://datatables.net/examples/plug-ins/range_filtering.html. However my (so far) only problem is accessing the $.fn.dataTable.ext.search array, to add and later remove my custom search function.

What is the path for this array, when going through angular-datatables?

Thanks in advance for your help.

 this.datatableElement.dtInstance.then((dtInstance: DataTables.Api) => {

      dtInstance. <-- what goes here?
 });
3
  • $.fn.dataTable.ext.search is a "global" list not specific to tables or dataTable instances. You should be able to use it right away (ad4 use $ internally). Perhaps you have forgotten to declare the $ alias but jQuery.fn.dataTable.ext.search.push() etc should work anywhere. Commented Oct 17, 2017 at 12:03
  • It claims that dataTable doesn't exist. Then when I change that to DataTable, it claims that ext doesn't exist. Commented Oct 19, 2017 at 12:37
  • It is almost waste of reps. Please show your code, and please elaborate more than "what goes here?" Commented Oct 23, 2017 at 8:55

1 Answer 1

3

Was solved by the developer at https://github.com/l-lin/angular-datatables/issues/1111

It was because the typings were not complete, when using typescript in angular. Correct reference is $.fn['dataTable'].ext.search

Sign up to request clarification or add additional context in comments.

1 Comment

can you provide a full code example for this with angular?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.