Cant get Individual Filter/Columnfilter to work
Cant get Individual Filter/Columnfilter to work
Hi guys,
I am working on a table and I want to filter my columns individualy. First I tried Columnfilters like this:
- I included the js file: jquery.dataTables.columnFilter.js.
- Then my js:
[code]var dataTable = $('#report_table').dataTable({
"bProcessing": true,
"bServerSide": true,
"aoColumns": data,
"sScrollX": "100%",
"sScrollXInner": "400%",
"bDeferRender": true,
"sScrollY": tableScrollHeight + "px",
"bScrollCollapse": true,
"sAjaxSource": windowUrl + "/getjsondata/",
"fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
$(nRow).on('click', function () {
window.open("report/bla/bla/" + aData[0],'_blank');
});
},
"oLanguage": {
"sUrl": "rapportage_tool/remaining_resources/dataTables.dutch.txt"
}
}).columnFilter();
[/code]
- This gave me the following error: Cannot read property 'sServerMethod' of undefined .
I googles this and the only solution I could find was:
[quote] Hi everyone I'm using DataTable 1.9.4 and column filter(very useful thanks a lot) about error :
"Uncaught TypeError: Cannot read property 'sServerMethod' of undefined"
I changed line 316 in jquery.dataTables.columnFilter.js from this:
oTable.fnSettings().fnServerData = function (sSource, aoData, fnCallback) {
to this:
oTable.fnServerData = function (sSource, aoData, fnCallback) {
it works for me. I hope it works for you too.[/quote]
- Well this did remove the error but still no columnfilter boxes were showing on my page (I use bootstrap 3 but this is not the problem I think (googled it).
Then i tried the version on the datatables site:
http://datatables.net/release-datatables/examples/api/multi_filter.html
Cant get this to work either, nothing is showing and no error is showing.... So can anybody help me how to fix this and let me filter on my columns, I am really out of options....
Thx!
I am working on a table and I want to filter my columns individualy. First I tried Columnfilters like this:
- I included the js file: jquery.dataTables.columnFilter.js.
- Then my js:
[code]var dataTable = $('#report_table').dataTable({
"bProcessing": true,
"bServerSide": true,
"aoColumns": data,
"sScrollX": "100%",
"sScrollXInner": "400%",
"bDeferRender": true,
"sScrollY": tableScrollHeight + "px",
"bScrollCollapse": true,
"sAjaxSource": windowUrl + "/getjsondata/",
"fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
$(nRow).on('click', function () {
window.open("report/bla/bla/" + aData[0],'_blank');
});
},
"oLanguage": {
"sUrl": "rapportage_tool/remaining_resources/dataTables.dutch.txt"
}
}).columnFilter();
[/code]
- This gave me the following error: Cannot read property 'sServerMethod' of undefined .
I googles this and the only solution I could find was:
[quote] Hi everyone I'm using DataTable 1.9.4 and column filter(very useful thanks a lot) about error :
"Uncaught TypeError: Cannot read property 'sServerMethod' of undefined"
I changed line 316 in jquery.dataTables.columnFilter.js from this:
oTable.fnSettings().fnServerData = function (sSource, aoData, fnCallback) {
to this:
oTable.fnServerData = function (sSource, aoData, fnCallback) {
it works for me. I hope it works for you too.[/quote]
- Well this did remove the error but still no columnfilter boxes were showing on my page (I use bootstrap 3 but this is not the problem I think (googled it).
Then i tried the version on the datatables site:
http://datatables.net/release-datatables/examples/api/multi_filter.html
Cant get this to work either, nothing is showing and no error is showing.... So can anybody help me how to fix this and let me filter on my columns, I am really out of options....
Thx!
This discussion has been closed.
Replies
[code] $('#report_table').append(function () {
var table = '';
for (var i = 0; i < data.length; i++) {
table += '';
}
table += '';
for (var i = 0; i < data.length; i++) {
table += '';
}
table += '';
table += '';
console.log(table);
})
[/code]