{
"sEcho": 0,
"iTotalRecords": 1,
"iTotalDisplayRecords": 1,
"aaData": [
[
"2011-10-27 14:32:39",
"Company added: ",
"sam",
"127.0.0.1"
]
],
"sColumns": "date,description,user,ipaddr"
}
{
"sEcho": 0,
"iTotalRecords": 2,
"iTotalDisplayRecords": 2,
"aaData": [
[
"",
"<a class=\"view_claim\" href=\"/claims/view/551110/\">551110</a>",
"07/25/2011",
"TPA1",
"STD",
4,
"James Fulbright",
"",
"<a class=\"attach search\" href=\"/claims/attach/12958873/551110/std_claims/\">Attach</a>"
],
[
"",
"<a class=\"view_claim\" href=\"/claims/view/12548/\">12548</a>",
"07/19/2011",
"TPA1",
"STD",
16,
"Wendal Lolley",
"",
"<a class=\"attach search\" href=\"/claims/attach/12958873/12548/std_claims/\">Attach</a>"
]
]
}
<table class="claims-search-table">
<thead>
<tr>
<th class="left"></th>
<th>Claim #</th>
<th>Date Received</th>
<th>Source</th>
<th>Claim Type</th>
<th>Employee #</th>
<th>Employee Name</th>
<th class="right"></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
$(document).ready(function() {
...
// claims search datatable
var claims_search_dt = $(".claims-search-table").dataTable({
"bAutoWidth": false,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": '/claims/search-claims/<?php echo $this->incident->id; ?>/',
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData = { has_select: 1 };
if ($('.claims-search-table').data("searchQuery")) {
$.extend(aoData, $('.claims-search-table').data("searchQuery"));
}
$.getJSON( sSource, aoData, function (json) { fnCallback(json); } );
},
"aoColumns": [
{ "bSortable": false },
{ "sName": "incident_number"},
{ "sName": "case_number"},
{ "sName": "employee_number"},
{ "sName": "employee_last_name"},
{ "sName": "employee_first_name"},
{ "sName": "open_date"},
{ "bSortable" : false},
{ "bSortable" : false}
],
"oLanguage": {
"sLengthMenu": "Show _MENU_",
"sProcessing": ""
},
"sDom": '<"fr"l><"table-top"r>t<"table-bottom"ip>'
});
allan said: Server-side processing requires the server to respond with more parameters that client-side processing with Ajax sourced data: <a href="http://datatables.net/usage/server-side" target="_blank" rel="nofollow">http://datatables.net/usage/server-side</a> .<br>
<br>
What does your JSON return look like?<br>
{
"sEcho": 1,
"iTotalRecords": 2,
"iTotalDisplayRecords": 2,
"aaData": [
[
"10",
"Agustin",
"Cortes",
"cargo"
],
[
"14",
"aaa",
"bbbb",
"Concejal"
]
]
}
$('#Tabla').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "includes/php/tablaPersonas.php",
"iDeferLoading":2,
"aoColumns": [{ "bVisible": false},null,null,null]
}).makeEditable({
sUpdateURL: "includes/php/actualizarPersona.php",
"aoColumns": [{
onblur: 'submit'
},
{
onblur: 'submit'
},
{
tooltip: 'Cargo',
type: 'select',
onblur: 'submit',
data: "{<?php foreach ($cargos as $cargo){ ?>'<?php print($cargo->idCargo);?>':'<?php print($cargo->cargo);?>',<?php }?>}",
sUpdateURL: "includes/php/actualizarPersona.php"
}
],
sAddURL: "includes/php/agregarPersona.php",
sAddHttpMethod: "POST",
sDeleteURL: "includes/php/quitarPersona.php",
sDeleteHttpMethod: "POST",
});
i don't know what could be the problem... any idea? It looks like you're new here. If you want to get involved, click one of these buttons!
Get useful and friendly help straight from the source.