DataTables warning: Cannot reinitialise datatable
DataTables warning: Cannot reinitialise datatable
Ironwil616
Posts: 50Questions: 0Answers: 0
I'm loading any of three partial views dynamically through an Ajax call in my MVC web application. Here's the bit that does the call:
[code]
$("#displayChoice").change(function ()
{
var displayChoice = $("#displayChoice").val();
var url = '<%= Url.Action("DisplayChoice", "Stakeholder") %>?displayChoice=' + displayChoice;
$.ajax({
url: url,
success: function (data)
{
// Replace html of div with new data.
$('#DynamicDisplay').html(data);
}
});
[/code]
This works without a problem, grabbing data from the server code and populating the indicated div, but I keep getting the error: "DataTables warning: Cannot reinitialise datatable". The table is not being reinitialised. This is the first time it is appearing on the page. For the moment, I'm going to comment out that error display code in the source, but I'd like to know if anything is going to crash as a result. The tables are loading with the expected data, paging works, but I get this annoying message.
Any ideas?
[code]
$("#displayChoice").change(function ()
{
var displayChoice = $("#displayChoice").val();
var url = '<%= Url.Action("DisplayChoice", "Stakeholder") %>?displayChoice=' + displayChoice;
$.ajax({
url: url,
success: function (data)
{
// Replace html of div with new data.
$('#DynamicDisplay').html(data);
}
});
[/code]
This works without a problem, grabbing data from the server code and populating the indicated div, but I keep getting the error: "DataTables warning: Cannot reinitialise datatable". The table is not being reinitialised. This is the first time it is appearing on the page. For the moment, I'm going to comment out that error display code in the source, but I'd like to know if anything is going to crash as a result. The tables are loading with the expected data, paging works, but I get this annoying message.
Any ideas?
This discussion has been closed.