Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8916551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:15:54+00:00 2026-06-15T05:15:54+00:00

Problem : using dataTables javascript library to display data perfectly fine. Data is retrieved

  • 0

Problem : using dataTables javascript library to display data perfectly fine.

Data is retrieved via PHP/mysql and then the table is drawn and the code cycles through the tables as such :

JAVA code for dataTables –

<script>
$(document).ready(function() {
    $("#PayMasterResults").dataTable( {
    "sPaginationType": "full_numbers",
    "bPaginate": false,
    "bJQueryUI" : true,
    "sScrollY": "215",
    "bLengthChange": true,
    "bFilter": true,
    "bSort": false,
    "bInfo": true,
    "bAutoWidth": false,
    "sDom": \'<"H"lTfr>t<"F"ip>\',
    "oTableTools": {
            "sSwfPath": "lib/copy_csv_xls_pdf.swf",
            "sRowSelect": "multi",
            "aButtons": [
                    "print",
                    {
                            "sExtends": "copy",
                            "sButtonText": "Copy to clipboard"
                    },
                    {
                            "sExtends": "csv",
                            "sButtonText": "Export CSV"
                    },
                    {
                            "sExtends": "xls",
                            "sButtonText": "Save for Excel"
                    },
                    {
                            "sExtends": "pdf",
                            "sButtonText": "Save to PDF",
                            "sPdfOrientation": "landscape",
                    }
            ]
    }
} );
});
</script>

HTML / PHP –

            <div class="table">
            <table class="display" id="PayMasterResults">
                    <thead>
                            <tr>
                             <th class="" width="600px"><b>Entry Description</b></th>
                             <th class=""><b>Entry Timestamp</b></th>
                             <th class=""><b>Debit/Credit</b></th>
                             <th class=""><b>Running Balance</b></th>
                            </tr>
                    </thead>
                    <tbody>
            ';
            for($x=0; $x<$xmldata->Ledger->count(); $x++) {
                    echo '
                            <tr class="gradeB">
                             <td><a href="#" onclick="loadPMLedgerDetail(\''.$xmldata->Ledger[$x]->attributes()->ID.'\',\''.$_POST['ID'].'\');">'.$xmldata->Ledger[$x]->Description.'</a></td>
                             <td>'.$xmldata->Ledger[$x]->Stamp.'</td>
                             <Td>'.$xmldata->Ledger[$x]->Amount.'</td>
                             <td>'.$xmldata->Ledger[$x]->Balance.'</td>
                            </tr>
                    ';
            }
            echo '
                    </tbody>
            </table>

            </div> <!-- End Table -->

—

The problem is, the table currently displays all data and the user can scroll down if they like, I need the table to have the scrollbar at the bottom of the table. so the User can scroll up, but not down.

I have attempted jquery scrollTop but that did not work, i cannot find any examples of people succesflly getting this to work.

— Attempt #2 after recommendation —

no luck unfortunately

<script>
$(document).ready(function() {
var myTable = $("#PMLedgerDetailsTable").dataTable( {
    "sPaginationType": "full_numbers",
    "aaSorting": [[ 0, "asc" ]],
    "bPaginate": true,
    "bJQueryUI" : true,
    "sScrollY": "215",
    "bLengthChange": true,
    "bFilter": true,
    "bSort": false,
    "bInfo": true,
    "bAutoWidth": false,
    "sDom": \'<"H"lTfr>t<"F"ip>S\',
    "oTableTools": {
            "sSwfPath": "lib/copy_csv_xls_pdf.swf",
            "sRowSelect": "multi",
            "aButtons": [
                    "print",
                    {
                            "sExtends": "copy",
                            "sButtonText": "Copy to clipboard"
                    },
                    {
                            "sExtends": "csv",
                            "sButtonText": "Export CSV"
                    },
                    {
                            "sExtends": "xls",
                            "sButtonText": "Save for Excel"
                    },
                    {
                            "sExtends": "pdf",
                            "sButtonText": "Save to PDF",
                            "sPdfOrientation": "landscape",
                    }
            ]
    },
    "fnInitComplete" : function() {
            myTable.fnSettings().oScroller.fnScrollToRow(10000);
    }
} );

});

</script>

Still no luck..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:15:55+00:00Added an answer on June 15, 2026 at 5:15 am

    If you use the Scroller extra, you can call the following in your initialization function:

    "fnInitComplete": function() { 
    
        // Make sure you have your table stored to a variable
        // (here, I used oTable).  Then tell the Scroller to
        // scroll to an arbitrary large number beyond the 
        // number of rows in your table.
    
        oTable.fnSettings().oScroller.fnScrollToRow(100000); 
    
        // Alternatively, if you know the number of rows in 
        // your table at runtime, you could just feed in that
        // value to the Scroller.
    }
    

    Best of luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to using Google Area Chart and PHP to display some data. problem
I am using jquery datatables to display data from a mysql database. When you
I am developing a webapp using Spring, jsp, javascript, jquery. I display a table
I'm using IgnitedDatatables (CodeIgniter library) for DataTables . The table gets generated without problems
I am using Datatables + jEditable to display data from my db and allow
I am attempting to use the highcharts javascript library to load charts using this
Using datatables. The problem is $('.checkbox') click function only works on first page of
I'm having some problem using multiple selectBooleanCheckBox in multiple DataTables in ui:repeat. Something like
So basically I am using jQuery Datatables server-side functionality with PHP to retrieve a
I'm having a problem loading a PHP file using .get (even used .load) with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.