Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35373

Search - OR vs AND

$
0
0

I've got a simple jQuery DataTable that fetches a JSON object via an AJAX call and builds the table. When I perform a simple text search by entering data in the search box, I seem to get an OR search instead of an AND search. The examples on the DataTables website indicate that an AND search is the default functionality. I suspect that the way the columns are being defined per the DT documentation for building an AJAX-based interface could be causing the issue but I'm unclear as how to use the aoColumns syntax with the AJAX call.

Here is my JavaScript:



 $(document).ready(function()
 {

 var mydatatable = $('#mydatatable').dataTable(
 {

    "ajax": "php/fetchopentasksbyuseridjson.php",
    "columns": [
        { "data": "pkid" },
        { "data": "shortdescription" },
        { "data": "opendate" },
        { "data": "duedate" },
        { "data": "type" },
        { "data": "priority" },
        { "data": "editclose" },
        { "data": "overdue" }
    ],

    "columnDefs":[
    {
         "targets":[6],
         "bSortable":false
    },
    {
        "targets":[7],
        "visible":false,
        "searchable":true
    }
    ]

});//end dataTable
});//end QJ DOM load

Viewing all articles
Browse latest Browse all 35373

Trending Articles