datable without pagination and search bar

datable without pagination and search bar

awais_naseemawais_naseem Posts: 3Questions: 0Answers: 0
edited January 2014 in General
Hello,

I am creating a dynamic html table and then converting it to datatable so no server side is involved. I want datatable without search bar and pagination like I showed in this screenshot. http://www.histone.com.pk/jing/datatable_001.png

If I put oSearch : false in the option I get an error from core file that disturb many things.
Thanks in advance.

Replies

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67
    I guess a more proper way exists, but for start you can try this css rule, try placing this in your css and make sure it loads last...

    .dataTables_filter, .dataTables_paginate, .dataTables_length {
    display: none;
    }
  • awais_naseemawais_naseem Posts: 3Questions: 0Answers: 0
    what if we have more than 1 page? I dont think so other page will also get appeared. what you say?
  • awais_naseemawais_naseem Posts: 3Questions: 0Answers: 0
    edited January 2014
    I have tried and it get done by two steps.

    1. .dataTables_filter, .dataTables_paginate, .dataTables_length, .dataTables_info {
    display: none;
    }
    2. Add "bPaginate": false

    Thanks
  • netametanetameta Posts: 39Questions: 0Answers: 0
    edited January 2014
    daniel_r this is the proper way:

    You'll need to set your "sDom" correctly to remove the search and disabled pagination.

    check the following:
    http://datatables.net/usage/options#sDom
    and
    http://datatables.net/usage/features#bPaginate

    those 2 should sort you out
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Absolutely. There is also a bFilter option to disable DataTables filtering complete.y.

    Allan
This discussion has been closed.