data_table.ext is undefined
data_table.ext is undefined
hasenstain
Posts: 3Questions: 1Answers: 0
Hello
I try to use data_table.ext.search.push to search for date in column... but it show me error
Uncaught TypeError: Cannot read properties of undefined (reading 'search')
When I debuging JS I found that .ext is undefined ..
Could you help me with that ?
my debug code is: imaguq
This question has an accepted answers - jump to answer
Answers
Looks like you have the incorrect syntax. Use
$.fn.dataTable.ext.search.push
. There is not an underscore indataTable
. If you still need help please post a link to your page or test case replicating the issue.https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Hi
there is fiddle
https://jsfiddle.net/8jb41uc9/1/
As I said you need to use
$.fn.dataTable.ext.search.push
instead ofdata_table.ext.search.push
. Updated test case:https://jsfiddle.net/g8pafkzc/
Kevin
Is it work now .. Thank you
Just for your information I take the example from this page
https://datatables.net/extensions/datetime/examples/integration/datatables.html
and there is
DataTable.ext.search.push(function (settings, data, dataIndex)
That will work too. I believe Datatables 1.13 introduced the use of
DataTable
in place of$.fn.dataTable
. Either form should work.Kevin