Responsive + search Individual Columns = Uncaught TypeError: n is null + jQuery.Deferred exception
Responsive + search Individual Columns = Uncaught TypeError: n is null + jQuery.Deferred exception
I'm using DataTables-1.13.1 plus Responsive-2.4.0 and am getting the above error. I've seen that the workaround is to add the "missing" footers to the table, but I don't want the users to search on ALL of the individual columns, just a certain set of them.
Are there plans to fix this or do I just have to continue to use this workaround or is there a better workaround?
exception stack trace below:
http://localhost:8088/reactrax/DataTables/datatables.min.js:16:61738
_e@http://localhost:8088/reactrax/DataTables/datatables.min.js:16:48385
http://localhost:8088/reactrax/DataTables/datatables.min.js:16:61248
iterator@http://localhost:8088/reactrax/DataTables/datatables.min.js:16:51704
http://localhost:8088/reactrax/DataTables/datatables.min.js:16:61158
http://localhost:8088/reactrax/DataTables/datatables.min.js:16:53187
http://localhost:8088/reactrax/DataTables/datatables.min.js:16:63996
http://localhost:8088/reactrax/DataTables/datatables.min.js:16:53187
http://localhost:8088/reactrax/DataTables/datatables.min.js:73:9267
filter@http://localhost:8088/reactrax/DataTables/datatables.min.js:16:51179
_resizeAuto@http://localhost:8088/reactrax/DataTables/datatables.min.js:73:9239
_constructor@http://localhost:8088/reactrax/DataTables/datatables.min.js:73:1730
d@http://localhost:8088/reactrax/DataTables/datatables.min.js:73:850
http://localhost:8088/reactrax/DataTables/datatables.min.js:73:14474
dispatch@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:5430:27
add/elemData.handle@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:5234:28
trigger@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:8719:12
http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:8797:17
each@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:385:19
each@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:207:17
trigger@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:8796:15
R@http://localhost:8088/reactrax/DataTables/datatables.min.js:16:47297
Jt@http://localhost:8088/reactrax/DataTables/datatables.min.js:16:32685
t@http://localhost:8088/reactrax/DataTables/datatables.min.js:16:8492
pe@http://localhost:8088/reactrax/DataTables/datatables.min.js:16:46064
he@http://localhost:8088/reactrax/DataTables/datatables.min.js:16:45003
http://localhost:8088/reactrax/DataTables/datatables.min.js:16:8567
each@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:385:19
each@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:207:17
C@http://localhost:8088/reactrax/DataTables/datatables.min.js:16:3487
P.fn.DataTable@http://localhost:8088/reactrax/DataTables/datatables.min.js:16:86253
createTable@http://localhost:8088/reactrax/reactrax.js:114:27
createTracksTable@http://localhost:8088/reactrax/contents.js:216:17
http://localhost:8088/reactrax/contents-page:97:3
mightThrow@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:3766:29
http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:3834:12
http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:3872:16
fire@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:3500:31
fireWith@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:3630:7
fire@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:3638:10
fire@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:3500:31
fireWith@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:3630:7
ready@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:4110:13
completed@http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:4120:9
http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:4136:11
http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:36:10
http://localhost:8088/reactrax/jquery-ui-1.13.2.custom/external/jquery/jquery.js:40:4
undefined jquery.js:4050:18
Uncaught TypeError: n is null
t http://localhost:8088/reactrax/DataTables/datatables.min.js:16
_e http://localhost:8088/reactrax/DataTables/datatables.min.js:16
t http://localhost:8088/reactrax/DataTables/datatables.min.js:16
iterator http://localhost:8088/reactrax/DataTables/datatables.min.js:16
He http://localhost:8088/reactrax/DataTables/datatables.min.js:16
<anonymous> http://localhost:8088/reactrax/DataTables/datatables.min.js:16
He http://localhost:8088/reactrax/DataTables/datatables.min.js:16
<anonymous> http://localhost:8088/reactrax/DataTables/datatables.min.js:16
r http://localhost:8088/reactrax/DataTables/datatables.min.js:73
filter http://localhost:8088/reactrax/DataTables/datatables.min.js:16
_resizeAuto http://localhost:8088/reactrax/DataTables/datatables.min.js:73
_constructor http://localhost:8088/reactrax/DataTables/datatables.min.js:73
d http://localhost:8088/reactrax/DataTables/datatables.min.js:73
<anonymous> http://localhost:8088/reactrax/DataTables/datatables.min.js:73
jQuery 7
R http://localhost:8088/reactrax/DataTables/datatables.min.js:16
Jt http://localhost:8088/reactrax/DataTables/datatables.min.js:16
t http://localhost:8088/reactrax/DataTables/datatables.min.js:16
pe http://localhost:8088/reactrax/DataTables/datatables.min.js:16
he http://localhost:8088/reactrax/DataTables/datatables.min.js:16
C http://localhost:8088/reactrax/DataTables/datatables.min.js:16
jQuery 2
C http://localhost:8088/reactrax/DataTables/datatables.min.js:16
DataTable http://localhost:8088/reactrax/DataTables/datatables.min.js:16
createTable http://localhost:8088/reactrax/reactrax.js:114
createTracksTable http://localhost:8088/reactrax/contents.js:216
<anonymous> http://localhost:8088/reactrax/contents-page:97
jQuery 13
datatables.min.js:16:61738
t http://localhost:8088/reactrax/DataTables/datatables.min.js:16
_e http://localhost:8088/reactrax/DataTables/datatables.min.js:16
t http://localhost:8088/reactrax/DataTables/datatables.min.js:16
iterator http://localhost:8088/reactrax/DataTables/datatables.min.js:16
He http://localhost:8088/reactrax/DataTables/datatables.min.js:16
<anonymous> http://localhost:8088/reactrax/DataTables/datatables.min.js:16
He http://localhost:8088/reactrax/DataTables/datatables.min.js:16
<anonymous> http://localhost:8088/reactrax/DataTables/datatables.min.js:16
r http://localhost:8088/reactrax/DataTables/datatables.min.js:73
filter self-hosted:241
filter http://localhost:8088/reactrax/DataTables/datatables.min.js:16
_resizeAuto http://localhost:8088/reactrax/DataTables/datatables.min.js:73
_constructor http://localhost:8088/reactrax/DataTables/datatables.min.js:73
d http://localhost:8088/reactrax/DataTables/datatables.min.js:73
<anonymous> http://localhost:8088/reactrax/DataTables/datatables.min.js:73
jQuery 7
R http://localhost:8088/reactrax/DataTables/datatables.min.js:16
Jt http://localhost:8088/reactrax/DataTables/datatables.min.js:16
t http://localhost:8088/reactrax/DataTables/datatables.min.js:16
pe http://localhost:8088/reactrax/DataTables/datatables.min.js:16
he http://localhost:8088/reactrax/DataTables/datatables.min.js:16
C http://localhost:8088/reactrax/DataTables/datatables.min.js:16
jQuery 2
C http://localhost:8088/reactrax/DataTables/datatables.min.js:16
DataTable http://localhost:8088/reactrax/DataTables/datatables.min.js:16
createTable http://localhost:8088/reactrax/reactrax.js:114
createTracksTable http://localhost:8088/reactrax/contents.js:216
<anonymous> http://localhost:8088/reactrax/contents-page:97
jQuery 13
Answers
There is nothing to fix. Datatables isn't actually adding these inputs. There is custom code created to add the inputs and create the search event handlers. The developer is in full control of these inputs and where they are placed.
Probably the easiest way to apply the search inputs to certain columns is to assign a classname to the desired columns in the
thead
. Then use that classname as thecolumn-selector
for the loop building the search functionality. Starting with this example I updated it to apply the search input to two columns. I also added responsive to the example:https://live.datatables.net/tegarujo/1/edit
Its hard to say why you are getting this error without seeing what you are doing. If you still need help then please provide a test case or update mine to show the issue you are having.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
I was able to get back to it looking normal by using the "visibility" property.
<th style="visibility: hidden;"></th>