Uncaught TypeError: Cannot read property 'oFeatures' of null
Uncaught TypeError: Cannot read property 'oFeatures' of null
Hi- I'm attempting to use the fnFilterAll plugin, but cannot seem to get it up and running.
I have 2 tables. As it stands right now, I am able to search both (when bFilter is set to true) individually. I would like my 'global' search filter to search on both tables.
I'm currently receiving an error: "Uncaught TypeError: Cannot read property 'oFeatures' of null" when I type into he filter.
Anyone have any ideas as to what could be going on here? I've spent about two hours trying to determine the null variable.
You can see the site at https://support.toptix.com/staff/kbsearch.php
I would post the debug, but it is giving me a JSON parsing error.
My code:
[code]
$(document).ready(function () {
$("tr").hover(function () {
$(this).addClass("hover");
},
function () {
$(this).removeClass("hover");
});
var oTable = $("#kbsearch").dataTable( {
"bPaginate": true,
"bLengthChange": false,
"oLanguage": {
"sSearch": "",
"oPaginate": {
"sNext": " Next >",
"sPrevious": "< Previous "
}
}
});
$("#ticketsearch").dataTable( {
"bFilter": false
});
$("#kbsearch_filter input").keyup( function () {
// Filter on the column (the index) of this element
oTable.fnFilterAll(this.value);
} );
$('#kbsearch_filter :input:visible:enabled:first').focus();
$("#kbsearch_filter input").val('Search Knowledgebase and Tickets by all Columns');
$("#kbsearch_filter input").addClass("gray");
$("#kbsearch_filter input").click(function() {
$(this).val('');
$(this).removeClass("gray");
});
});
[/code]
I have 2 tables. As it stands right now, I am able to search both (when bFilter is set to true) individually. I would like my 'global' search filter to search on both tables.
I'm currently receiving an error: "Uncaught TypeError: Cannot read property 'oFeatures' of null" when I type into he filter.
Anyone have any ideas as to what could be going on here? I've spent about two hours trying to determine the null variable.
You can see the site at https://support.toptix.com/staff/kbsearch.php
I would post the debug, but it is giving me a JSON parsing error.
My code:
[code]
$(document).ready(function () {
$("tr").hover(function () {
$(this).addClass("hover");
},
function () {
$(this).removeClass("hover");
});
var oTable = $("#kbsearch").dataTable( {
"bPaginate": true,
"bLengthChange": false,
"oLanguage": {
"sSearch": "",
"oPaginate": {
"sNext": " Next >",
"sPrevious": "< Previous "
}
}
});
$("#ticketsearch").dataTable( {
"bFilter": false
});
$("#kbsearch_filter input").keyup( function () {
// Filter on the column (the index) of this element
oTable.fnFilterAll(this.value);
} );
$('#kbsearch_filter :input:visible:enabled:first').focus();
$("#kbsearch_filter input").val('Search Knowledgebase and Tickets by all Columns');
$("#kbsearch_filter input").addClass("gray");
$("#kbsearch_filter input").click(function() {
$(this).val('');
$(this).removeClass("gray");
});
});
[/code]
This discussion has been closed.
Replies
Uncaught TypeError: Cannot read property 'oFeatures' of null jquery.dataTables.js:5419
DataTable.fnFilter jquery.dataTables.js:5419
$.fn.dataTableExt.oApi.fnFilterAll datatables.fnFilterAll.js:12
DataTable.oApi._fnExternApiFunc jquery.dataTables.js:6077
(anonymous function) kbsearch.php:46
jQuery.event.dispatch jquery-1.7.2.js:3332
jQuery.event.add.elemData.handle.eventHandle jquery-1.7.2.js:2941
Allan
Allan
Do you think it could have anything to do with the fact that JSLINT tells me I have a parser error?
[code]
$.fn.dataTableExt.oApi.fnFilterAll = function(oSettings, sInput, iColumn, bRegex, bSmart) {
var settings = $.fn.dataTableSettings;
for ( var i=0 ; i
It must have worked by fluke (certainly not by the DataTables API design) in older versions, but 1.9 cleaned a lot of things up, and it must have taken this quick out.
Sorry I didn't pick that up immediately, but thanks very much for letting me know about this! I've committed the fix to the plug-ins repo and its up on the site now.
Interestingly enough, with DataTables 1.10 I'm planning on updating the whole API to be able to do this kind of thing (apply to multiple tables), thus removing the need for the plug-in: http://datatables.net/development/roadmap :-)
Allan
I look forward to the new release!