Big data pagination, scrolling query

Big data pagination, scrolling query

hsajjadhsajjad Posts: 28Questions: 0Answers: 0
edited November 2013 in DataTables 1.9
Apparently there's Pagination plug-in with a host of good features (http://datatables.net/plug-ins/pagination), there's also a Scroller (http://datatables.net/extras/scroller/) that's very suitable for Big data use case.

Question: can they both be used together, as some control over the dataset to jump ahead/back to first/last part of a scrollable dataset would be cool. Also, is there an example (or near example) that can help show this?

Thanks

Replies

  • hsajjadhsajjad Posts: 28Questions: 0Answers: 0
    Hi,

    Not sure how do I make the built-in pagination type 'full_numbers' to fetch more server-side data? I can see it paginate beautifully on the client side, but I have more data sitting on the server (initial fetch size is 500). I'm not sure how do I integrate this to gain more server side data and expand based on demand?

    I'm sure this is a generic / common use case. Any pointers on the dataTables solution for this would be very appreciated. Thanks!
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    > Question: can they both be used together

    No - sorry. Scroller hooks into DataTables pagination controls and the paging controls are irrelevant in that state.

    It sounds like you might find Scroller with server-side processing useful: http://datatables.net/release-datatables/extras/Scroller/server-side_processing.html . It only loads data as it needs it.

    Allan
  • hsajjadhsajjad Posts: 28Questions: 0Answers: 0
    Thanks Allan - The Scroller is looking good with pipelining enabled to fetch a good healthy number fetched from DB in advance.

    One minor layout glitch - the Scrollbar disturbs tables Viewport which now overlaps with the top right search box. I'm using the 'pretty' style template from here: http://datatables.net/blog/Creating_beautiful_and_functional_tables_with_DataTables

    Table setting:
    [code]
    var oTable = $('#table_id').dataTable( {
    "bScrollInfinite": true,
    "bScrollCollapse": true,
    "sScrollY": "500px",
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "/ismb/api/gui/getMessage",
    "aoColumns": [
    { "mData": "busId" },
    { "mData": "sourceSystem" },
    { "mData": "receiveTime" },
    { "mData": "validationStatus" },
    { "mData": "messageId" }
    ],
    "sDom": "frtiS",
    "oScroller": {
    "loadingIndicator": true
    },
    "fnServerData": fnDataTablesPipeline,
    "bDeferRender": true
    [/code]

    Thanks!
  • hsajjadhsajjad Posts: 28Questions: 0Answers: 0
    Also I see NaN :

    Showing 2,190 to 2,208 of NaN entries (filtered from 2,969 total entries)

    While I have the iTotalRecords, iDisplayStart, iDisplayLength props part of JSON returned from the server. What else is required that maps to NaN?

    Thanks
  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Can you link to a test page showing these problems so I can take a look and see what might be causing them please.

    Allan
  • hsajjadhsajjad Posts: 28Questions: 0Answers: 0
    Found the issue the NaN was due to a missing server side property (iTotalDisplayRecords).

    Thanks
This discussion has been closed.