Datatable filtering via external form
-
I’m using DataTable along with the column filter extension. Pretty simple, just upload both DataTable and the column filter extension like any other plugin for WordPress… but I want to customize it a bit more. I found the documentation on using an external form with the column filter at https://jquery-datatables-column-filter.googlecode.com/svn/trunk/external.html and have set up my code like this:
$(‘#tablepress-1’).dataTable()
.columnFilter({aoColumns:[
{ sSelector: “#grantcategory”, type:”select” },
{ sSelector: “#grantyear”, type:”select” },
{ sSelector: “#grantrecipient” },
{ sSelector: “#grantcity” },
{ sSelector: “#grantregion”, type:”select” },
{ sSelector: “#grantamount”, type: “number-range” }
]}
);My question is, where do I put this to make it take effect? Right now I just have it added to the “columnfilter.js” that came with the download of the column filter extension. But it’s obviously not supposed to go where I have it as I get an error message:
“DataTables warning (table id = ‘tablepress-1’): Cannot reinitialise DataTable.
To retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy”Where am I supposed to put my code?
- The topic ‘Datatable filtering via external form’ is closed to new replies.