error: 'aoPreSearchCols[...]' is null or not an object

error: 'aoPreSearchCols[...]' is null or not an object

antipotter2006antipotter2006 Posts: 2Questions: 0Answers: 0
edited February 2011 in General
I keep getting this error " error: 'aoPreSearchCols[...]' is null or not an object" when i try to apply individual column filtering for 2 tables my tables are displayed in tabs . the filtering on individual columns on the first table works fine but the individual filtering on the second table throws and error . Is there a workaround for this issue . I think it throws an exception because the second table shows up as inactive .

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Which version of DataTables are you using? Can you post a link to an example please?

    Allan
  • antipotter2006antipotter2006 Posts: 2Questions: 0Answers: 0
    can i zip d files and send it to u i have written nice example in .net. The datatables are returned and the coloumns are dynamic using webservices i would also like to keep this copy available for ppl to download and understand how to use datatables so can u give me a id where i can post these files
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Unfortunately I don't have a .NET environment so I won't be able to run any example which relies on it - just static pages :-). You can ping me using http://datatables.net/contact and I'll reply with my e-mail address if you want - or just a file hosting service would do nicely.

    Allan
  • conraj1conraj1 Posts: 1Questions: 0Answers: 0
    I had a similar issue, here is a fix - added to line 1493 in dataTables-1.7.6. The problem is that for whatever reason, oSettings.aoPreSearchCols[ iColumn ] is not defined for the column I was filtering on. One fix is to bring over the code from _fnAddColumn (lines 2508-2517) over to the location in 1493. Another would be do just assign the new values using the same creation via { ... } instead of [i] = .;

    (bring this code to 1493, or can we call a common method that inits preSearchCols?)
    /* There was a bug where this was being called, but for whatever reason, the aoPreSearchCols[ iColumn ] is not yet defined.
    /* Add a column specific filter */
    if ( typeof oSettings.aoPreSearchCols[ iColumn ] == 'undefined' ||
    oSettings.aoPreSearchCols[ iColumn ] === null )
    {
    oSettings.aoPreSearchCols[ iColumn ] = {
    "sSearch": "",
    "bRegex": false,
    "bSmart": true
    };
    }
This discussion has been closed.