Hi,
I am trying to get the individual column filtering (select) example working with an AJAX source.
The table displays perfectly but at this point, unfortunately, all my drop downs are empty.
My code is as follow:
$(document).ready(function() {
var oTable = $('#example').dataTable( {
"bProcessing": true,
"sAjaxSource": 'json.txt',
"aoColumns": [
{ "mData": "id_region" },
{ "mData": "region_name" },
{ "mData": "division" }
]
} );
$("tfoot th").each( function ( i ) {
this.innerHTML = fnCreateSelect(oTable.fnGetColumnData(i));
$('select', this).change( function () {
oTable.fnFilter( $(this).val(), i );
} );
} );
} );
apparently, oTable.fnGetColumnData returns an empty array because aiRows.length is always 0. I just don't understand why!
Am I doing something wrong?
I am trying to get the individual column filtering (select) example working with an AJAX source.
The table displays perfectly but at this point, unfortunately, all my drop downs are empty.
My code is as follow:
$(document).ready(function() {
var oTable = $('#example').dataTable( {
"bProcessing": true,
"sAjaxSource": 'json.txt',
"aoColumns": [
{ "mData": "id_region" },
{ "mData": "region_name" },
{ "mData": "division" }
]
} );
$("tfoot th").each( function ( i ) {
this.innerHTML = fnCreateSelect(oTable.fnGetColumnData(i));
$('select', this).change( function () {
oTable.fnFilter( $(this).val(), i );
} );
} );
} );
apparently, oTable.fnGetColumnData returns an empty array because aiRows.length is always 0. I just don't understand why!
Am I doing something wrong?