language + column search
language + column search
rstubbe
Posts: 3Questions: 2Answers: 0
I try to use both the column search and the language option.
When I use the example for column search https://datatables.net/examples/api/multi_filter.html it worjs.
As soon as i add the language option the search fails.
i made the following change:
var table = $('#example').DataTable( {
language: {
url: '//cdn.datatables.net/plug-ins/3cfcc339e89/i18n/Dutch.json'
}
} );
Does anyone know how to fix this?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The example here
http://datatables.net/examples/advanced_init/language_file
includes "http:". Maybe that's the problem?
No tried that, also tried a local file, but always the same issue.
For what i can tell, the text that you put in one colums for searching, is actually searched over all columns, resulting none or limited number of records returned.
I have an example here: http://jsfiddle.net/rstubbe/drLjy4rt/
My apologies - I misunderstood the question. I'm afraid I don't have an answer for you.
You need to use the
initComplete
callback to build the filters. It isn't working when you include the language file since the language file is Ajax loaded - therefore the code for building the filter is running before the table has been fully created (the "A" in Ajax is for Asynchronous remember :-) ).Take a look at this example to see how to use
initComplete
.I've only included the
http
there for people who are loading downloaded examples usingfile://
. Using//
is actually good practice since it means that the same protocol as the page was loaded with will be used (i.e. http or https - both work for the CDN). file:// however obviously won't work!Allan