Searchable not working
Searchable not working
Hi everyone,
I need some help, about my Datatable.
I use Datatable in lot of page with the same base et the same version.
But actually I have a problem : the functionality "searchable" don't working, whereas my others pages with Datatable and the functionality "searchable" works correctly.
<cfoutput>
<table class="normal" width="100%" border="0" cellspacing="1" cellpadding="2" id="listeReferencement">
<thead>
<tr>
<th>Agence</th>
<th>ETT</th>
<th>Référencer / Déréférencer</th>
<th>Origine : BAPS-ETT</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</cfoutput>
<script type="text/javascript">
$(document).ready(function(){
var oTable = $('#listeReferencement').dataTable(
{
"bProcessing": true
,"bServerSide": true
,"sAjaxSource": "./paging/processPaging.cfm?type=referencerAgences"
,"aoColumns":
[
{"sWidth": "15%"},
{"sWidth": "10%"},
{"sWidth": "1%"},
{"sWidth": "1%"}
]
,"aoColumnDefs": [
{ "bSearchable": false, "aTargets": [2,3] },
{ "sClass": "center", "aTargets": [2,3] }
]
,"fnInitComplete": function(oSettings, json) {
new FixedHeader( oTable, {"offsetTop": offtop});
}
});
});
</script>
I can't post a screenshot, but I have 4 columns, and the two last are with the html code : "<img src='image.png'>"
So, I preclude this two columns, because I thinking it's the problem but... No.
I have in Firebug : "TypeError: json is null"
I can try to search with a "a" but with an other character not working, like "b" or anything...
I try to debug since 2 days I become crazy... If you have any idea, I take her
Thank you in advance and good evening,
Nymesia
This question has an accepted answers - jump to answer
Answers
Sounds like the server-side script you are using isn't correctly implement the client / server-side protocol that DataTables uses. See the legacy manual since you appear to be using the legacy options.
Allan
Hi,
Thanks for your response, I had tried to use this manual before to come and ask my question. I will try to do more precise because I haven't my solution.
I don't find my error....
I send :
(without search and that works)
", " " ] ] } ?>with search and the response that is "Json is null" :
Just sEcho is different, is it important ??
I try to understand but I don't know where is the bug !
Nymesia
sEcho
is important if you are using the legacy server-side protocol - from the documentation:However, I would be truly amazed if a different
sEcho
is causing the JSON data to return anull
value.The
null
suggests to me that the server-side script is not coping with the data in the database. Have you checked your server's errors logs for any debug information.Allan
And with an other Datatable of my application who working correctly I have :
I had deleted the columns 4 to 7 but it's the same model =/
It's with a lot of type of html etc... I'm really lost with this problem.
Nymesia
Oh my god it's working !
Thanks you so much !
I had deleted of my where clause, the columns with "img" because I send a "column_filter" in my where clause of my query... So it is impossible to have an image in my query return...
It's working perfectly !
Thanks again !
Good evening to you,
Nymesia