fnReloadAjax Issue - not a function
fnReloadAjax Issue - not a function
ev0lution37
Posts: 8Questions: 2Answers: 0
Hi all,
I've tried all the fixes I've seen online to no avail, so I figured I'd post to the forums. Getting the 'fnReloadAjax is not a function' error even after setting the variable to global and ensuring that dataTables was loaded before my custom JS file. Here's my code:
[code]
var sources_table_var;
$(document).ready(
function () {
sources_table_var = $('#sources_table').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bServerSide": true,
"sAjaxSource": "./SourcesServlet",
'aoColumns': [
{
'mData': 'sourceId',
"bVisible" :false,
"bSearchable":false
},
{
'mData': 'statusId',
"sWidth" : "15%"
},
{
'mData': 'sourceName',
'sWidth': "20%"
},
{
'mData': 'ExObjects',
'sWidth': "15%"
},
{
'mData': 'robotName',
'sWidth': "20%"
},
{
'mData': 'coverageId',
'sWidth': "30%"
},
]
});
$('#mysourceinfo_ol_unfollow').click(function() {
$.get($("#context").val() + '/unfollowSource?source_name=' + $('#info_source_name').html(),function(data) {
sources_table_var.fnReloadAjax();
$('#mysourceinfo_ol').fadeOut();
$("#sources_error").html(data);
$("#sources_error").show().delay(5000).fadeOut();
});
});
[/code]
For the initialization on the HTML:
[code]
Sources
[/code]
Any idea why it isn't refreshing the table when the button is clicked? Thanks in advance.
I've tried all the fixes I've seen online to no avail, so I figured I'd post to the forums. Getting the 'fnReloadAjax is not a function' error even after setting the variable to global and ensuring that dataTables was loaded before my custom JS file. Here's my code:
[code]
var sources_table_var;
$(document).ready(
function () {
sources_table_var = $('#sources_table').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bServerSide": true,
"sAjaxSource": "./SourcesServlet",
'aoColumns': [
{
'mData': 'sourceId',
"bVisible" :false,
"bSearchable":false
},
{
'mData': 'statusId',
"sWidth" : "15%"
},
{
'mData': 'sourceName',
'sWidth': "20%"
},
{
'mData': 'ExObjects',
'sWidth': "15%"
},
{
'mData': 'robotName',
'sWidth': "20%"
},
{
'mData': 'coverageId',
'sWidth': "30%"
},
]
});
$('#mysourceinfo_ol_unfollow').click(function() {
$.get($("#context").val() + '/unfollowSource?source_name=' + $('#info_source_name').html(),function(data) {
sources_table_var.fnReloadAjax();
$('#mysourceinfo_ol').fadeOut();
$("#sources_error").html(data);
$("#sources_error").show().delay(5000).fadeOut();
});
});
[/code]
For the initialization on the HTML:
[code]
Sources
[/code]
Any idea why it isn't refreshing the table when the button is clicked? Thanks in advance.
This discussion has been closed.
Replies