new_init.xml 915B

1234567891011121314151617181920212223242526
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <dt-example table-type="html" order="1">
  3. <css lib="datatables tabletools" />
  4. <js lib="jquery datatables tabletools">
  5. <![CDATA[
  6. $(document).ready(function() {
  7. var table = $('#example').DataTable();
  8. var tt = new $.fn.dataTable.TableTools( table );
  9. $( tt.fnContainer() ).insertAfter('div.info');
  10. } );
  11. ]]>
  12. </js>
  13. <title lib="TableTools">Initialisation with `new`</title>
  14. <info><![CDATA[
  15. Typically when working with TableTools, the initialisation and insertion into the DOM will be done automatically by DataTables, through the use of the `dt-init dom` parameter. However, it is also possible to initialise TableTools manually as shown in the example below using `new $.fn.dataTable.TableTools();`.
  16. Once initialised you can insert the TableTools tool bar node anywhere you wish into the DOM using the `fnContainer()` API method to get the node.
  17. ]]></info>
  18. </dt-example>