[solved] Any clue on why I can't get a DataTables API instance ?
[solved] Any clue on why I can't get a DataTables API instance ?
Ok, hello everybody.
That made four days that I'm on a problem that drives me crazy. As a non developper, I suspect the answer may be simple but I could't find a solution : I can't access to the DataTable API and I need it to use the column multi filter method as shown in the examples section > http://www.datatables.net/examples/api/multi_filter_select.html .
Here is the context :
- first, url : http://ecofilae.effetgraphique.com/references/ ;
It's a wordpress dev site inside a multisite install, language locale is french.
for testing and sake of the simplicity purposes of test case, the DataTables script part is inserted inside the header.
But I tested this before, correctly inserted through the function.php file of the custom theme I use, using wp_register_script and so on.
Using Firebug, I can see that files' HTTP calls and all seems to be OK. jQuery is loaded before my script, then my script is loaded.
I can use dataTables() (yes, and get the jQuery object), all is working.
But as soon as I try to use a .DataTable() on my table in my script, I get an error.
The API seems to be un-available. (I get a "DataTables is not a function" from the FF console).
If I try to use a simple $(document).ready(); to insert my script, even the dataTable(); code isn't working.
In fours days, i tried many methods in a long and painfull process of trials and errors and can't found a correct one.
Now I'm over. If anyone here passing by has a solution, I would be relieved.
And oh, I've just forgot, using a wordpress DataTables plugin is not an option : since I need to format a custom PHP table inside a custom template and then use DataTables() on it. (yeah, i tried this too, it doesn't work either).
Thanks in advance to anyone who could help.
This question has an accepted answers - jump to answer
Answers
There is something wrong with the DataTables file that your page is including. It looks like it might be an extremely old version of DataTables - v1.0 or there about!
Could you update the file to use v1.10 please?
Allan
Thanks Allan.
Done, and it works. Many many thanks !
I don't know how an why I reached such a level of confusion to download an old version and stubbornly continue to try to use it without logically check the DataTables version.
Well, I guess that will make a good one that you may share if you want ... I feel dumb. -__-
Anyway, thank you for this awesome support. I've just register as supporter, because of such a great support for a simple forum user.