Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35272

How do you access the Scroller extension API on the latest DataTables CDN code?

$
0
0

I am using a Bootstrap Modal to contain the table, and I have successfully initialized the DataTable instance in the hidden div, and got it to resize the columns when the modal is shown. The problem is when I try to use the Scroller extension on this table, it doesn't render properly, and I can't figure out the correct syntax to use to access the fnMeasure function on the Scroller API. Everything I've tried so far results in fnMeasure not defined, or scroller not defined or similar.

Here is my current attempt:

$(document).ready( function () {

  var table = $('#example').DataTable({
    "scrollY": '200px',
    "dom": 'ftiS'    
  });

  $('#show_modal_btn').on('click', function(){
    $('#table_modal').modal('show');
  });

  
  $('#table_modal').on( 'shown.bs.modal', function(e){
        table.columns.adjust().oScroller.fnMeasure();

    });

} );

I've created a test case here

Also note that the the Scroller CSS (I think), doesn't play nicely with Bootstrap CSS, as the filter box gets obsured by the tables header.


Viewing all articles
Browse latest Browse all 35272

Trending Articles