user3603801
user3603801

Reputation: 1

need footer information in the header section in jQuery dataTables

I am using jQuery dataTables.

Due to large number of records, I need footer information "Showing 1 to 2 of 2 entries (filtered from 3352 total entries)" in the header section after the "Show Entries" text.

Please suggest how can we achieve this?

Thanks in advance.

Code I am using like this:

<img src="<?=PIXEL;?>" onload="initializeDataTables('user_listing'); $('.yournet_button').button();"/>


function initializeDataTables(divid)
{
    $('#'+divid).dataTable( {
            "iDisplayLength": 25,
            "aLengthMenu": [[25, 50, -1], [25, 50, "All"]],
            "aaSorting": [[ 1, "desc" ]],
            "bJQueryUI": true,
            "sPaginationType": "full_numbers"
    } );
} 

used:

Upvotes: 0

Views: 103

Answers (1)

Bhushan Kawadkar
Bhushan Kawadkar

Reputation: 28513

here you just need to pass "dom": '<"top"i>rt<"bottom"flp><"clear">' while calling datatables... see below code

function initializeDataTables(divid)
{
    $('#'+divid).dataTable( {
            "iDisplayLength": 25,
            "aLengthMenu": [[25, 50, -1], [25, 50, "All"]],
            "aaSorting": [[ 1, "desc" ]],
            "bJQueryUI": true,
            "sPaginationType": "full_numbers",
            "dom": '<"top"i>rt<"bottom"flp><"clear">'
    } );
}

see this for your reference.

Upvotes: 1

Related Questions