ERROR - oSettings is null
ERROR - oSettings is null
Hello,
I realize a search engine. I use DataTables to display my results.
During an initial search my table appears fine. Each table row has a link.
In a second search, my picture is always displayed correctly, but when I click on my links, I get error "oSettings is null."
Button to lunch seach
[code]
[/code]
On click, function ajax for display my results
[code]
function chargementAjax()
{
$.ajax(
{
type : "POST",
url : 'traitement.php',
data :
{
radio: $('input[name="radio"]:checked').val(),
checkZA: $('#ZA').is(":checked"),
nomEtab: $('#nom').val(),
nomResp: $('#nom_resp').val(),
Commune: $('#Commune option:selected').val(),
},
beforeSend: function()
{
$("#result").html("");
},
success: function(server_response)
{
alert ("Donnees recues");
$("#result").html(server_response);
alert ("Affichage des resultats");
}
});
}
[/code]
Function DataTables
[code]
$(document).ready(function()
{
var oTable;
oTable = $('#tabresult').dataTable(
{
"bDestroy": true,
"bProcessing": false,
//"bServerSide": true,
"sAjaxSource": '***/json.php',
"fnDrawCallback":function()
{
$('#tabresult tbody tr').hover(function()
{
$(this).css('cursor', 'pointer');
}, function()
{
$(this).css('cursor', 'auto');
});
},
"oLanguage":
{
"sSearch": "Rechercher dans toutes les colonnes :",
"sLengthMenu": "Afficher _MENU_ résultats",
"sLoadingRecords": "Chargement...",
"sProcessing": "En cours de traitement...",
"sSearch": "Rechercher :",
"sZeroRecords": "Aucun résultat trouvé.",
"sEmptyTable": "Pas de données valides pour le tableau",
"sInfo": "Affichage de _START_ à _END_ résultats sur _TOTAL_",
"sInfoEmpty": "Affichage de 0 à 0 résultats sur 0",
"sInfoFiltered": "(filtered from _MAX_ total entries)",
"oPaginate":
{
"sFirst": "Première",
"sFirst": "Première",
"sLast": "Dernière",
"sNext": "Suivante",
"sPrevious": "Précédente"
}
},
});
$(document).on('click', '#tabresult tr', function()
{
// alert('This is a click on a dynamic element');
var aData = oTable.fnGetData( this );
alert( aData[4] );
document.location.href = ('***.php?Codebis='+ aData[4])
});
});
[/code]
If anyone can help me please
I realize a search engine. I use DataTables to display my results.
During an initial search my table appears fine. Each table row has a link.
In a second search, my picture is always displayed correctly, but when I click on my links, I get error "oSettings is null."
Button to lunch seach
[code]
[/code]
On click, function ajax for display my results
[code]
function chargementAjax()
{
$.ajax(
{
type : "POST",
url : 'traitement.php',
data :
{
radio: $('input[name="radio"]:checked').val(),
checkZA: $('#ZA').is(":checked"),
nomEtab: $('#nom').val(),
nomResp: $('#nom_resp').val(),
Commune: $('#Commune option:selected').val(),
},
beforeSend: function()
{
$("#result").html("");
},
success: function(server_response)
{
alert ("Donnees recues");
$("#result").html(server_response);
alert ("Affichage des resultats");
}
});
}
[/code]
Function DataTables
[code]
$(document).ready(function()
{
var oTable;
oTable = $('#tabresult').dataTable(
{
"bDestroy": true,
"bProcessing": false,
//"bServerSide": true,
"sAjaxSource": '***/json.php',
"fnDrawCallback":function()
{
$('#tabresult tbody tr').hover(function()
{
$(this).css('cursor', 'pointer');
}, function()
{
$(this).css('cursor', 'auto');
});
},
"oLanguage":
{
"sSearch": "Rechercher dans toutes les colonnes :",
"sLengthMenu": "Afficher _MENU_ résultats",
"sLoadingRecords": "Chargement...",
"sProcessing": "En cours de traitement...",
"sSearch": "Rechercher :",
"sZeroRecords": "Aucun résultat trouvé.",
"sEmptyTable": "Pas de données valides pour le tableau",
"sInfo": "Affichage de _START_ à _END_ résultats sur _TOTAL_",
"sInfoEmpty": "Affichage de 0 à 0 résultats sur 0",
"sInfoFiltered": "(filtered from _MAX_ total entries)",
"oPaginate":
{
"sFirst": "Première",
"sFirst": "Première",
"sLast": "Dernière",
"sNext": "Suivante",
"sPrevious": "Précédente"
}
},
});
$(document).on('click', '#tabresult tr', function()
{
// alert('This is a click on a dynamic element');
var aData = oTable.fnGetData( this );
alert( aData[4] );
document.location.href = ('***.php?Codebis='+ aData[4])
});
});
[/code]
If anyone can help me please
This discussion has been closed.