Scrolling - scrollingPagination.js OR scroller.js plugin ?

Scrolling - scrollingPagination.js OR scroller.js plugin ?

btBillbtBill Posts: 31Questions: 0Answers: 0
edited July 2013 in Plug-ins
I'm using the datatables 1.10-dev version and trying to figure out how to stop the header from overwriting my custom styled header row that I created.

i see in the code that the version of scrolling I am using now:
'sScrollY' : '250px',
'bScrollInfinite' : true,
'bScrollCollapse' : true,

'bScrollInfinite' maps to 'bInfinite' and the comments there say this is deprecated.
/**
* Infinite scrolling enablement flag. Now deprecated in favour of
* using the Scroller plug-in.
* Note that this parameter will be set by the initialisation routine. To
* set a default use {@link DataTable.defaults}.
* @type boolean
*/

So I've tried:
'sScrollY' : '250px',
'bPaginate' : true,
'sPaginationType' : 'scroller',
And only getting 'pluging is undefined errors.
I have included it in the code, but it does not pick it up.
I've tried changing the 'sPaginationType' to 'scrolling', as I orginally saw in the documentation, but nothing is coming up.

What am I missing?

Any suggestions would be greatly appreciated.

Thank you.

Replies

  • allanallan Posts: 61,584Questions: 1Answers: 10,084 Site admin
    If you want to use Scroller, don't set sPaginationType: 'scroller' - there is no such pagination type. Where did you see that int he documentation (so I can fix it)? Do something like this: http://datatables.net/release-datatables/extras/Scroller/index.html .

    Allan
  • btBillbtBill Posts: 31Questions: 0Answers: 0
    I will check on the 'scroller' setting, but I had also tried 'scrolling'
    Anyway, I tried to setup a fiddle; http://jsfiddle.net/BdHXh/

    Another issue is that when I try to include the datatables.scroller.js file, I get the error 'Scroller requires 1.9.0 ...' I'm using the 1.10-dev version and there seems to be a number of things deprecated.

    When I try 1.9.4, everything locks up and the script never completes.

    I'm not currently using sDom and when I use: "sDom": "frtiS", the table looses it's footer, he search shows back up and the pagination (continus scrolling) doesnt work. Also, when using the 'S' it shows up as the 'two-button' pagination by default it seems.

    I have to be missing something.
  • allanallan Posts: 61,584Questions: 1Answers: 10,084 Site admin
    Well firstly you need to use sDom to add Scroller since that `S` in the above sDom means 'Scroller'. Secondly about the 1.9.0+ error, are you using the development version of Scroller as well as the dev version of DataTables?

    Allan
  • btBillbtBill Posts: 31Questions: 0Answers: 0
    OK, I'm using the dev version of scroller, error is gone about the DT 1.9 version, but now getting:

    'this.s.dt.oApi._fnCalculateEnd is not a function'

    I added the
    #history table#invoices tbody > tr > td {
    white-space: nowrap;
    }
    to my CSS and it ends correctly with the last row.

    Also, it says in the footer: 'Showing 1 thru 9 of 100' even though only 6 are showing.

    And finally, using the 'sDom' I loose my custom footer styling I had.
    I need to retain my custom footer styling as well as the custom header styling I have lost.

    Thanks for the follow ups.
  • btBillbtBill Posts: 31Questions: 0Answers: 0
    edited July 2013
    OK, getting closer....

    I am using "sDom": '<"H">rtS<"F"i>', (because I finally noticed the 'if you're using jQueryUI' part...)
    and I have my footer back.

    BUT...

    The rows now roll past the nd of the table allowing the scroller to continue and the table empties.

    Now... if i can turn off the custom headers that scrolling is making, I think I would be in business (once the 'this.s.dt.oApi._fnCalculateEnd is not a function' error goes away)
  • allanallan Posts: 61,584Questions: 1Answers: 10,084 Site admin
    > this.s.dt.oApi._fnCalculateEnd

    That's likely don't to breaking the whole draw process. Have you tried picking up Scroller from git? That error should be fix as I committed a change for it a few weeks back: https://github.com/DataTables/Scroller/commits/master

    Allan
  • btBillbtBill Posts: 31Questions: 0Answers: 0
    Ok, that error is gone now, thanks.

    Issues that remain:

    - Total of records showing is off.. When the table shows 6 it says 11, and when I scroll through them all, it says 206 of 114

    - Custom header gone. (I'm thinking from the above response, that you meant that this is gone due to header redraw for scroller bar, but is there a way to not have it redraw?)

    Thanks again.
  • allanallan Posts: 61,584Questions: 1Answers: 10,084 Site admin
    Can you link me to the page showing the problem please?

    Also, are all rows the same height? That is a requirement of Scroller.

    Allan
This discussion has been closed.