Remove "Show entries"

Remove "Show entries"

spidogrspidogr Posts: 23Questions: 9Answers: 0

I tested with using something like the one below from this page without any luck. Seems like the dom parameters do not apply.

$('#example').dataTable( {
  "dom": 'rtip'
} );

When I tested with something like the one below, changes apply, but do not know how to use it to remove "Show entries" control

$(document).ready(function() {
    $('#example').DataTable( {
        "paging":   false,
        "ordering": false,
        "info":     false
    } );
} );

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,327Questions: 26Answers: 4,949

    I copied your first code snippet here:
    http://live.datatables.net/zigohuli/1/edit

    When you say "Show entries control" I assume you mean this:

    This is the Length Change element. The example with your dom configuration removes this element. Is this what you are looking for?

    Kevin

  • spidogrspidogr Posts: 23Questions: 9Answers: 0
    edited June 2021

    Yes, only that it also removes search as well. This is my html:

    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="datatables.min.css"/> 
    <script type="text/javascript" src="jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="datatables.min.js"></script>
    <script>
    $(document).ready( function () {
      $('#example').dataTable( {
        "dom": 'rtip'
      } );
    } );
    </script>
    </head>
    
  • kthorngrenkthorngren Posts: 21,327Questions: 26Answers: 4,949
    edited June 2021 Answer ✓

    The dom docs describe what element each letter represents:

    l - length changing input control
    f - filtering input
    t - The table!
    i - Table information summary
    p - pagination control
    r - processing display element
    

    The paging buttons show in my example. You will need to add f to place the search input. Like this:
    http://live.datatables.net/zigohuli/2/edit

    Not sure what you mean by removing the styles. Maybe you are getting a Javascript error - look at your browser's console. If this doesn't help then please post a link to your page or a test case showing the issues. You can update my example.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • spidogrspidogr Posts: 23Questions: 9Answers: 0

    Yeah, it was my bad. Adding "f" at the end of the line added search box at the bottom, that is why I could not see it.

Sign In or Register to comment.