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.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

The best way to debug slow web pages cover image

The best way to debug slow web pages

Tools like Page Speed Insights and Google Lighthouse are great for providing advice for front end performance issues. But what these tools can’t do, is evaluate performance across your entire stack of distributed services and applications.

Watch video

πŸ‘‹ Kindness is contagious

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

Okay