Bug Report: Scroller plugin tries to initialize even if disabled

Bug Report: Scroller plugin tries to initialize even if disabled

michaelcmmichaelcm Posts: 4Questions: 1Answers: 0

Hello,

We have Scroller loaded for some tables, but for others (notable reorder tables) we have chosen to have paging (and scroller off) so all the records can be reordered easily with drag and drop. As it stands this error is displayed:
Uncaught Error: DataTables warning: table id=DataTables_Table_0 - Pagination must be enabled for Scroller

For those tables we tried this setting:

paging: false,
scroller: false

Or simply:

scroller: false

But neither prevent scroller from loading. Looks like we need something like this:

@@ -1228,7 +1228,11 @@ if ( typeof $.fn.dataTable == "function" &&
                "fnInit": function( oDTSettings ) {
                        var init = oDTSettings.oInit;
                        var opts = init.scroller || init.oScroller || {};

+                       // Only initialize scroller if enabled
+                       if( !init.scroller )
+                               return;
+
                        new Scroller( oDTSettings, opts );
                },
                "cFeature": "S",

Thanks!

Replies

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    Hi,

    The code change above suggests that you are using the legacy S parameter in the dom option. If that is the case, then by there being an S in that string, it means that Scroller is enabled and should be initialised.

    I would suggest dropping the S option from dom.

    Allan

  • michaelcmmichaelcm Posts: 4Questions: 1Answers: 0

    We don't actually have S in there...
    dom: '<"reportHeader"lf>rt<"reportFooter"ip>'

    Any other suggestions would be appreciated.

    Thanks!

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin

    As far as I am aware, the only way that the code you made the change in above can be executed is if the S option is in the dom parameter.

    Could you give me a link to the page showing the issue please?

    Allan

This discussion has been closed.