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?
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?
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
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:
You can see a list of parameters in the link: link