column.search() not passing value to server

column.search() not passing value to server

CBolandCBoland Posts: 9Questions: 3Answers: 0

I'm using DataTables in server mode. Data retrieval is otherwise working correctly, but individual column search is not passing the search value to the server.

I've created a fiddle here that demonstrates the problem:

http://jsfiddle.net/hexonx/pvqe9osc/2/

And a DataTables Debug report (from my actual project, not the fiddle):

http://debug.datatables.net/ulevep

Steps to Reproduce:
1. Load the fiddle.
2. Open developer tools in your browser to view Network traffic.
3. Enter a value in the 'Search EmpNum' text box.
4. View the body of the network request.

Note: A script error will occur when the table makes its ajax request. Ignore this. We are only interested in the contents of the request body.

The search value entered into the search text box isn't sent in either the column.search.value property or the table's search.value property. Am I missing something?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,237Questions: 1Answers: 10,418 Site admin
    Answer ✓

    Haha - that took me a while to realise what was happening. Searching isn't working because it is disabled: searching: false,!

    Remove that and it will work okay. If you want to remove the default search input box, use the dom option.

    Allan

  • CBolandCBoland Posts: 9Questions: 3Answers: 0

    That worked, allan. Thanks!

    Here are the working relevant settings:

    var table = $("#dataTable").DataTable({
        ...
        searching: true,
        dom: "ltip"  // Remove global search box
    });
    
This discussion has been closed.