How to disable JqueryDatatables auto search?

2

I'm using Jquery Datatables, and I need to remove the auto search it has, by leaving a "Search" button next to

Has anyone done this yet?

    
asked by anonymous 08.09.2014 / 23:12

2 answers

2

Removing the search and other inputs from Jquery DataTables is done through the Sun attribute

I solved my problem using this:

 "dom": '<"top">rt<"bottom"ip><"clear">'

It removes only the Input and not the search functionality

For more details, follow Documentation

    
10.10.2014 / 15:16
2

You can use bFilter :

 $(document).ready(function() {
        $('#example').dataTable({ "bFilter": false});
    });

Another way to do this is by using the'Dom ':' t '. Where parameter 't' stands for 'the table', it removes header, footer, field search, pagination, and other components. Leaving only the table.

Take a look at this example.

html:

<html>
    <title>exemplo</title>
        <head>          
            <link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.0/css/jquery.dataTables.css">
            <link rel="stylesheet" type="text/css" href="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.0/css/jquery.dataTables_themeroller.css">                
        </head>
    <body>
        <div class="container">
        <table cellpadding="0" cellspacing="0" border="0" class="dataTable" id="example">
            <thead>
                <tr>
                <th>Rendering engine</th>
                <th>Browser</th>
                <th>Platform(s)</th>
                <th>Engine version</th>
                <th>CSS grade</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>Presto</td>
                    <td>Opera 9.0</td>
                    <td>Win 95+ / OSX.3+</td><td>-</td>
                    <td>A</td>
                </tr>
                <tr>
                    <td>Presto</td>
                    <td>Opera 9.0</td>
                    <td>Win 95+ / OSX.3+</td><td>-</td>
                    <td>A</td>
                </tr>
            </tbody>
        </table>
        </div>
    <script type="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></script><scripttype="text/javascript" charset="utf8" src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.0/jquery.dataTables.min.js"></script></body></html>

js:

$(document).ready(function(){$('#example').dataTable({"sDom":"t"});
});

Example in jsfiddle:

link

You can see a list of parameters in the link: link

    
05.01.2015 / 20:16