Out-of-the-box search not working
Out-of-the-box search not working
andyfurniss
Posts: 5Questions: 2Answers: 0
Just like to say that DataTables seems great so far - good job!
I've just set up DataTables to display some internal data for staff. I want to be able to use the search functionality provided with DataTables and I can see that there is an input for this by default. It was working at one point but now it seems to do nothing when I type into it. I'm not sure what I;'ve done to break it. All I have is the following:
HTML:
<table id="ops-br-table" class="table-full-width">
<thead>
<tr>
<th>Request Date</th>
<th>Operator</th>
<th>Tour ID</th>
<th>Tour Name</th>
<th>Duration</th>
<th>Comments</th>
<th>Name</th>
<th>Email Address</th>
<th>Brochure Sent</th>
<th>First Chase Sent</th>
<th>Second Chase Sent</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
JavaScript:
$('#ops-br-table').DataTable({
ajax: {
url: tap.settings.apiBaseUrl + 'interactions/brochurerequests',
dataSrc: ''
},
columns: [
{
data: 'requestDate',
type: 'date',
render: $.fn.dataTable.render.moment('YYYY-MM-DDTHH:mm:ss', 'ddd DD MMMM YYYY'),
defaultContent: ''
},
{ data: 'tourDetail.operator.name' },
{ data: 'tourId' },
{ data: 'tourDetail.tourName' },
{ data: 'tourDetail.tourDuration' },
{ data: 'userComment' },
{ data: 'user.friendlyIdentifier' },
{ data: 'user.email' },
{
data: 'sentDate',
type: 'date',
render: $.fn.dataTable.render.moment('YYYY-MM-DDTHH:mm:ss', 'ddd DD MMMM YYYY'),
defaultContent: ''
},
{
data: 'firstChaseDate',
type: 'date',
render: $.fn.dataTable.render.moment('YYYY-MM-DDTHH:mm:ss', 'ddd DD MMMM YYYY'),
defaultContent: ''
},
{
data: 'secondChaseDate',
type: 'date',
render: $.fn.dataTable.render.moment('YYYY-MM-DDTHH:mm:ss', 'ddd DD MMMM YYYY'),
defaultContent: ''
}
]
});
Any help would be greatly appreciated!
This discussion has been closed.
Answers
Do you have any errors in your browser's console?
Generally if the Datatables functions don't work there is an exception error stopping the Javascript.
Kevin
Actually, ignore me. I was being an idiot and searching for something that was actually in both of the available rows (derp), which made it appear like nothing was happening...
Feel free to close/delete this.