Is there a list of data-attributes for DataTables?

Is there a list of data-attributes for DataTables?

trustedsamuraitrustedsamurai Posts: 9Questions: 4Answers: 0

Hello,

I like the idea of using data attributes to configure some of the settings for DataTables. Is there a list of these somewhere? I can't find it.

For example, I'd like to use this to configure which columns remain visible on a smaller viewport.

Thanks,

John.

Answers

  • trustedsamuraitrustedsamurai Posts: 9Questions: 4Answers: 0

    I might have just worked this out.

    When you view JS examples you can use the command named in the double quotes as your data attribute. and the responses you add enter contained within single quotes.

    ie: the below JS example would be

    $('#example').dataTable( {
    "paging": false
    } );

    <table class="DataTables" id="table1" data-paging='false'>
    
  • kthorngrenkthorngren Posts: 20,257Questions: 26Answers: 4,761

    Here are the docs for using the HTML5 data attributes as config options:
    https://datatables.net/manual/options#HTML-5-data-attributes

    Kevin

  • trustedsamuraitrustedsamurai Posts: 9Questions: 4Answers: 0

    Hello Kevin,

    Thank you for replying. I've seen this section and found it very interesting. I guess each data attribute is identified through out the specifications for Data tables.

    I have trouble identifying them in the documentation because there are quite a few different elements at play. is there a common theme to this? ie: are data attributes identified in the documentation with a certain colour?

    Thanks.

This discussion has been closed.