Moving info (#_info) content elsewhere
Moving info (#_info) content elsewhere
I'd like to be able to place the content (e.g. Showing 1 to 25 of 398 entries (filtered from 1,632 total entries)) into an existing element on my page.
I've tried several methods for this but can;t find one that displays the correct information (as seen in the #crmData_info div in the footer - my table is called crmData) when content is first loaded and any filtering/pagination takes place.
Table setup as follows:
[code]
objTable = $('#crmData').dataTable( {
"aoColumns": [
{ "sWidth": "5%", "sClass": "alignCenter", "sType": "string" },
{ "sWidth": "0%", "bSortable": false, "bVisible": false },
{ "sWidth": "10%" },
{ "sWidth": "55%" },
{ "sWidth": "20%"},
{ "sWidth": "10%", "sClass": "alignCenter", "sType": "string" }
],
"aaSorting": [[3,'asc']],
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bPaginate": true,
"bFilter": true,
"bSort": true,
"bAutoWidth": false,
"bInfo": true,
"bProcessing": true,
"iDisplayLength": 25,
"sAjaxSource": "my_ajax_file_that_prints_json.php",
"sDom": '<"H"rplfT>t<"F"ip>',
"bStateSave": true,
"fnServerData": function ( sSource, aoData, fnCallback ) {
var aoData = new Array();
var iArchive = (document.getElementById("chkArchive").checked==true) ? 1 : 0;
aoData.push( { "name": "allocatedUser", "value": $('#cmbAllocatedUser').val() } );
aoData.push( { "name": "recordType", "value": $('#cmbRecordType').val() } );
aoData.push( { "name": "industryType", "value": $('#cmbIndustry').val() } );
aoData.push( { "name": "includeArchive", "value": iArchive } );
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
} );
}
});
[/code]
I've tried several methods for this but can;t find one that displays the correct information (as seen in the #crmData_info div in the footer - my table is called crmData) when content is first loaded and any filtering/pagination takes place.
Table setup as follows:
[code]
objTable = $('#crmData').dataTable( {
"aoColumns": [
{ "sWidth": "5%", "sClass": "alignCenter", "sType": "string" },
{ "sWidth": "0%", "bSortable": false, "bVisible": false },
{ "sWidth": "10%" },
{ "sWidth": "55%" },
{ "sWidth": "20%"},
{ "sWidth": "10%", "sClass": "alignCenter", "sType": "string" }
],
"aaSorting": [[3,'asc']],
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bPaginate": true,
"bFilter": true,
"bSort": true,
"bAutoWidth": false,
"bInfo": true,
"bProcessing": true,
"iDisplayLength": 25,
"sAjaxSource": "my_ajax_file_that_prints_json.php",
"sDom": '<"H"rplfT>t<"F"ip>',
"bStateSave": true,
"fnServerData": function ( sSource, aoData, fnCallback ) {
var aoData = new Array();
var iArchive = (document.getElementById("chkArchive").checked==true) ? 1 : 0;
aoData.push( { "name": "allocatedUser", "value": $('#cmbAllocatedUser').val() } );
aoData.push( { "name": "recordType", "value": $('#cmbRecordType').val() } );
aoData.push( { "name": "industryType", "value": $('#cmbIndustry').val() } );
aoData.push( { "name": "includeArchive", "value": iArchive } );
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
} );
}
});
[/code]
This discussion has been closed.
Replies
Allan
This is what happens:
on first draw I get in my element: Showing 0 to 0 of 0 entries
whilst in the _info element is: Showing 1 to 10 of 3,561 entries
Then, upon clicking next (pagination) I get....
in my element: Showing 1 to 10 of 3,561 entries
in the _info element: Showing 11 to 20 of 3,561 entries
It always seems to be one step behind
Allan