Bug Report: Scroller plugin tries to initialize even if disabled
Bug Report: Scroller plugin tries to initialize even if disabled
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
Hi,
The code change above suggests that you are using the legacy
S
parameter in thedom
option. If that is the case, then by there being anS
in that string, it means that Scroller is enabled and should be initialised.I would suggest dropping the
S
option fromdom
.Allan
We don't actually have S in there...
dom: '<"reportHeader"lf>rt<"reportFooter"ip>'
Any other suggestions would be appreciated.
Thanks!
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 thedom
parameter.Could you give me a link to the page showing the issue please?
Allan