newbie question

newbie question

jmfampjmfamp Posts: 1Questions: 0Answers: 0
edited January 2016 in Free community support

Looking at the data export example...here is the listed js:

$(document).ready(function() {
    $('#example').DataTable( {
        dom: 'Bfrtip',
        buttons: [
            'copy', 'csv', 'excel', 'pdf', 'print'
        ]
    } );
} );

I don't understand what the dom: 'Bfrtip' refers to...looking at the html and css for the example, I don't see anything with that name. Can I leave it out?

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Replies

  • allanallan Posts: 63,210Questions: 1Answers: 10,415 Site admin

    I don't understand what the dom: 'Bfrtip' refers to

    The dom reference documentation defines what that parameter is.

    From that documentation:

    Each table control element in DataTables has a single letter associated with it, and that letter it used in this dom configuration option to indicate where that element will appear in the document order.

    In this case you need to define it to add the Buttons control. You can leave it out and have it use the default (also documented in the reference) but then Buttons wouldn't be inserted. You need to tell DataTables where you want the buttons to appear which is why it is needed.

    Allan

This discussion has been closed.