API for toolbar

API for toolbar

jeronejerone Posts: 12Questions: 0Answers: 0
edited August 2010 in General
Is there any API for including features to the toolbar (besides the length and filter feature)?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    New features can use the development API: http://datatables.net/development/features . This is what TableTools does. Or you can do something like in this example: http://datatables.net/examples/advanced_init/dom_toolbar.html

    Allan
  • jeronejerone Posts: 12Questions: 0Answers: 0
    I was thinking more like with this (http://datatables.net/examples/basic_init/themes.html) example, to add more features (div's) to the toolbar before and below.

    ps. The width's from both .dataTables_length and example_filter aren't necessary. Joined sizes aren't even 100% combined.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I see what you mean - yes this is possible. You can use sDom ( http://datatables.net/usage/options#sDom ) to modify the DOM controlled by DataTables.

    Allan
  • jeronejerone Posts: 12Questions: 0Answers: 0
    Yeah, found that too, but what if I'm developing a plugin. Then sDom is variable.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I'm not quite following - sorry. Perhaps you could explain what you are looking to achieve? The development API I mentioned can be used to create a new 'feature' (such as the search or length changing). TableTools does exactly this: http://datatables.net/release-datatables/extras/TableTools/ . The feature letter will instruct DataTables to call the plug-in and insert whatever DOM elements it adds.

    Allan
This discussion has been closed.