How can I hide/drop the Show dropdown box in CSS

How can I hide/drop the Show dropdown box in CSS

moh1234moh1234 Posts: 8Questions: 0Answers: 0
edited February 2014 in General
I have nearly managed to make bServerSide work with Paginate with SQL Server.
For each request I am returning 100 rows together with count of total rows as below:

sEcho = param.sEcho,
iTotalRecords = 875,
iTotalDisplayRecords = 100

so for example page 2 will return rows from: 101-200

The datatable paginate then works out the page numbers. However I need hide/drop the Show dropdown box (can be in CSS) because once I change the dropdown option it messes up my page numbers and I do not want the option for user to change the entries showed on the page. It will be fixed at 100.

I have tried bPaginate to false but this also removes the page nos therefore I need it set to true - "bPaginate": true because this will generate my page numbers.

Replies

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Use the bLengthChange option .

    Allan
  • moh1234moh1234 Posts: 8Questions: 0Answers: 0
    Thanks Allan worked - Also is there a way of moving the page nos and the text "Showing 1 ... entries (filtered ....)" to the top of the table rather then at the bottom ??
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Use sDom :-)
  • moh1234moh1234 Posts: 8Questions: 0Answers: 0
    Allan When I am returning:

    iTotalRecords = 875,
    iTotalDisplayRecords = 100,

    The number of pages should be from 1-9 but I am getting pages 1-10 ?? Why is the datatable including an additional empty page ?
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    > iTotalDisplayRecords = 100,

    From the documentation ( http://datatables.net/usage/server-side ):

    > iTotalDisplayRecords Total records, after filtering (i.e. the total number of records after filtering has been applied - not just the number of records being returned in this result set)

    Allan
  • moh1234moh1234 Posts: 8Questions: 0Answers: 0
    Allan Yes but with 875 being totalRecords (records in the database) the page nos should be 1 - 9 and NOT 1 - 10 ??
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    I see. I have no idea why that would be happening - I'd need to see a test case to be able to debug it.

    Allan
This discussion has been closed.