How do I make my search results return with the example cited below. I'm looking to get a partial word matching in the first few characters in my global search. I found this code below but I don't know where to insert them in my code. Here's the sample output that I want to achieve.
Search Key: Male
Output: Male (Should not return Female)
Search Key : Female
Output: Female (Should not return Male)
Search Key: Fem
Output: Female
I'm not sure if this code below would resolve it.
Code:
search: {
smart: false
}
My JS Code:
function showData(dataArray)
{
$(document).ready(function()
{
$('#data-table')
.DataTable(
{
"DisplayLength" : 5 ,
"scrollY": "400px",
"scrollCollapse": true,
data: dataArray,
//CHANGE THE TABLE HEADINGS BELOW TO MATCH WITH YOUR SELECTED DATA RANGE
columns: [
{"title":"Name", "width": "2%", "targets": 0},
{"title":"Age", "width": "3%", "targets": 0},
{"title":"Location", "width": "2%", "targets": 0},
{"title":"Sex", "width": "2%", "targets": 0},
{"title":"Occupation", "width": "3%", "targets": 0},
{"title":"Salary Grade", "visible": false },
],
// SETS POSITION OF DATA TABLES
dom:
"<'row'<'col-sm-12 col-md-5'l><'col-sm-12 col-md-6'f><'col-sm-12 col-md-1'B>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-12 col-md-7'i><'col-sm-12 col-md-7'p>>",
buttons: {
dom: {
button: {
tag: 'button',
className: ''
}
},
buttons: [{
extend: 'copy', // DO NOT EDIT, this is the function that calls copy to clipboard
text: '<i class="fa fa-copy" aria-hidden="true"></i> Get Salary',
className: 'btn btn-primary',
header: false, // Disable export header table
exportOptions: {
columns: [5] // Select Salary Grade columns to be exported
},
title: null // Disable title on exported data
}]
}
});
});
}