HELP!!! sVal is undefined When trying to use one table to control another

HELP!!! sVal is undefined When trying to use one table to control another

grahambrgrahambr Posts: 5Questions: 0Answers: 0
edited November 2011 in DataTables 1.8
I had a script that I didnt touch, that USED to work where upon clicking on one table, it filtered a different table. Now, all of a sudden, it is throwing a Jscript error of: sVal is undefined. Javascript error at position (6051:5): Unable to get value of the property 'replace': object is null or undefined : jquery.dataTables.js (6051:5)
[code]
function _fnEscapeRegex ( sVal )
{
var acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\', '$', '^' ];
var reReplace = new RegExp( '(\\' + acEscape.join('|\\') + ')', 'g' );
return sVal.replace(reReplace, '\\$1');
}
[/code]

Here is the code that I am using:

[code]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">





BASIC Table Example

@import "datatables/media/css/demo_page.css";
@import "datatables/media/css/demo_table.css";








$(document).ready(function() {
var oTable1;

$("#example tbody").click(function(event) {
$(oTable1.fnSettings().aoData).each(function (){
$(this.nTr).removeClass('row_selected');
var anSelected = fnGetSelected( oTable1 );
oTable2.fnFilter(this.innerHTML, oTable2.customers_id);
});
$(event.target.parentNode).addClass('row_selected');
});


/* Get the rows which are currently selected */
function fnGetSelected( oTableLocal )
{
var aReturn = new Array();
var aTrs = oTableLocal.fnGetNodes();

for ( var i=0 ; i

Replies

  • grahambrgrahambr Posts: 5Questions: 0Answers: 0
    The error is happening when I click on a row in the first table.
This discussion has been closed.