I am relatively new to yadcf.
I want to place a search filter on a datatable of type 'auto_complete'.
The suggestions offered should be based on an ajax-call based on the clients input.
It seems that the call is not made when I start typing (no request are send to the server).
The suggestions offered are based on the loaded data and not based on the ajax-call.
What am I doing wrong? I can't find a good example.
My code:
yadcf.init(oTable, [{
column_number: 0,
filter_default_label: "Enter a familyname...",
filter_type: "auto_complete",
filter_plugin_options: {
source: function( request, response ) {
$.ajax({
url: "/bamcers-ajax/familienaam",
dataType: "json",
type : 'Get',
data: { familyname: request.term },
success: function( data ) { response( data.a );}
})
},
minLength: 2
},
sort_as: "alpha",
style_class: 'width250'
}, columndefs...
Note: This code works fine
$( "#testField" ).autocomplete({
source: function( request, response ) {
$.ajax({
dataType: "json",
type : 'Get',
url: '/bamcers-ajax/familienaam',
data: {familienaam: request.term},
success: function(data) {response( data );}
});
},
minLength: 2
});