Column Filter plug-in doesn't work after recreating Datatable

Column Filter plug-in doesn't work after recreating Datatable

hkn87hkn87 Posts: 1Questions: 0Answers: 0
edited March 2013 in General
Hi everyone. I have little problem about recreating my datatable with an ajax call.

What i use;

Datables 1.9.4
Datatables column filter plug-in 1.5.0

What i want;

I have a search page. Every time search button is clicked i get data with ajax call and create datatable on fly according to result i received.

In every ajax call i destroy my existing datatable and re-create it.

My problem;

After destroying my datatable i can create my new datatable without problem but column-filters stop working.


My code;

[code] $("#myTable").dataTable().fnDestroy(true); [/code]

[code]
var dataTable = $("#myTable").dataTable({
bAutoWidth: false,
sPaginationType: "full_numbers",
bJQueryUI: true,
bProcessing: true
});
[/code]

[code]

dataTable.columnFilter(
{
sPlaceHolder: "head:before",
sRangeFormat : '',
aoColumns: [
{
type: "text",
bRegex: true,
bSmart: true
},
{
type: "text",
bRegex: true,
bSmart: true
}

]} );
[/code]

The error i receive;

[quote]
Uncaught TypeError: Cannot read property 'oApi' of null
[/quote]


Thanks for your attention.

Replies

  • DosseaDossea Posts: 4Questions: 0Answers: 0
    I'm experiencing the same problem. Hope there will be a solution soon...
  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Sounds like an issue with the column filter plug-in. I'd suggest filing a bug report for that project.

    Allan
  • DosseaDossea Posts: 4Questions: 0Answers: 0
    Voila, done!
    https://code.google.com/p/jquery-datatables-column-filter/issues/detail?id=119
  • btBillbtBill Posts: 31Questions: 0Answers: 0
    Where are people getting the columnFilter 1.5 ?
    All I see when I download it is 0.9 from 2011
  • DosseaDossea Posts: 4Questions: 0Answers: 0
    I got it from the official page (https://jquery-datatables-column-filter.googlecode.com/svn/trunk/index.html).

    Here's the direct link: https://jquery-datatables-column-filter.googlecode.com/svn/trunk/media/js/jquery.dataTables.columnFilter.js
  • btBillbtBill Posts: 31Questions: 0Answers: 0
    Thanks.
    I was on the http://code.google.com/p/jquery-datatables-column-filter/ page and missed the
    'External Links' heading where it gives the link to the newest releases. The 'Download' heading choice still has a .9 version.

    Was driving me nuts :)
This discussion has been closed.