Move Buttons

Move Buttons

anakin59490anakin59490 Posts: 20Questions: 7Answers: 0

Hi,
is it possible to move buttons above length manu and search elements :

Thank you

This question has an accepted answers - jump to answer

Answers

  • anakin59490anakin59490 Posts: 20Questions: 7Answers: 0

    This is my actual config :

    this.dtOptions = {
          pagingType: 'full_numbers',
          lengthMenu: [[5, 10, 25, 50, -1], [5, 10, 25, 50, 'Tous']],
          responsive: true,
          language: {
            lengthMenu: '    Afficher _MENU_ documents par page',
            zeroRecords: 'Aucune tâche disponible',
            info: 'Page _PAGE_ sur _PAGES_',
            infoEmpty: 'Aucun enre disponible',
            infoFiltered: ' (filtré(s) sur _MAX_ enregistrements)',
            paginate: {
              first:      'Premier',
              last:       'dernier',
              next:       'Suivant',
              previous:   'Precedent'
            },
            search: '_INPUT_',
            searchPlaceholder: 'Recherche',
          },
          // select: true,
          stateSave: true,
          order: [[1, 'desc']],
          // Declare the use of the extension in the dom parameter
          dom: 'Blfrtip',
          select: true,
          initComplete:  function (settings, json) {
            $('.button').removeClass('dt-button');
          },
          // Configure the buttons
          buttons: [
            {
              text: 'Sélection',
              className: 'table-button button btn btn-danger btn-sm',
              attr: {
                disabled : that.isDisabled
              },
              // available: function ( dt, config ) {
              //   console.log(dt);
              // },
              action: function (e, dt, node, config) {...}
            },
            {
              text: 'Copy to div',
              action: function ( e, dt, node, config ) {
                // Copy an array based DataTables' data to another element
                $('#output').html( dt.data().map( function (row) {
                  console.log(row);
                  return row.join(' | ' );
                } ).join('<br>'));
              }
            }
          ]
    
    
  • anakin59490anakin59490 Posts: 20Questions: 7Answers: 0

    I use 'dom' parameter but i don't find the correct setence

  • anakin59490anakin59490 Posts: 20Questions: 7Answers: 0

    OK;

    I remove "buttons.dataTables.css" in angular.cli and it works

  • colincolin Posts: 15,236Questions: 1Answers: 2,598
    Answer ✓

    Hi @anakin59490 ,

    I'm surprised you can see the buttons without that CSS, but if it's working, then all good :)

    Cheers,

    Colin

This discussion has been closed.