Reputation: 21
I keep getting an "Uncaught ReferenceError: yadcf is not defined" when selecting a filter option that was created using the yadcf.init method. Here's the fiddle: http://jsfiddle.net/emLfa5s0/3/
var oTable;
$(document).ready(function () {
'use strict';
oTable = $('#test').DataTable({
'retrieve': true,
'paging': true, // Table pagination
'ordering': true, // Column ordering
'info': true, // Bottom left status text
'bAutoWidth': true, // Bottom left status text
"bJQueryUI": true,
"dom": 'lrtip',
"oLanguage": {
sLengthMenu: '_MENU_ records per page',
info: 'Showing page _PAGE_ of _PAGES_',
zeroRecords: 'Nothing found - sorry',
infoEmpty: 'No results available',
infoFiltered: '(filtered from _MAX_ total records)'
},
"deferRender": true
});
yadcf.init(oTable, [{
column_number: 0,
column_data_type: "html",
filter_type: "multi_select"
},{
column_number: 1,
filter_type: "multi_select"
}], "footer");
});
STEPS TO RECREATE 1) The filters appear which demonstrate that yadcf was correctly initialized and that calling the init method did not visibily fail. You can verify this by opening up the developer console and clicking the 'Run' button 2) When a filter value is selected the error referenced above appears in the console.
I was trying to quickly put together a shareable demo of a different issue I was experiencing but this error prevents me from getting there.
Upvotes: 0
Views: 708
Reputation: 37061
You have to include yadcf js file (and its css) using the External Resources of jsfiddle and not by dumping the entire code in the js/css panels
See working jsfiddle
(b.t.w you better use chosen/select2 along with yadcf for a better looking UI)
Upvotes: 1