DEV Community

Cover image for How to add Filtering to Jquery Datatables
Samson Adesanoye
Samson Adesanoye

Posted on

2

How to add Filtering to Jquery Datatables

DataTables has a number of table control elements available and where they are placed in the DOM. The table control elements is defined by the dom parameter. This parameter can be a little confusing at first, because letters are used to represent different element for example the letter B is used for Buttons in the example below:

$('#myTable').DataTable( {
    dom: 'Bfrtip',
    buttons: [
        'copy', 'excel', 'pdf'
    ]
} );
Enter fullscreen mode Exit fullscreen mode

Meaning:
l - length changing input control
f - filtering input
t - The table!
i - Table information summary
p - pagination control
r - processing display element

Plugins:
B - Buttons
R - ColReorder
S - Scroller
P - SearchPanes
Q - SearchBuilder

Conclusion
Combining plugins together with different letters bring the best out of jquery datatables.

Image of Datadog

Master Mobile Monitoring for iOS Apps

Monitor your app’s health with real-time insights into crash-free rates, start times, and more. Optimize performance and prevent user churn by addressing critical issues like app hangs, and ANRs. Learn how to keep your iOS app running smoothly across all devices by downloading this eBook.

Get The eBook

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay