showing the paging controls at the top and bottom of the datatable

showing the paging controls at the top and bottom of the datatable

brianboltonbrianbolton Posts: 4Questions: 0Answers: 0
edited August 2009 in General
How do I show the paging controls on the top and bottom of the datatable?

Here's my current configuration:
[code]
var oTable;
var asInitVals = new Array();

$(document).ready(function() {
oTable = $('#bulletinGridSimple').dataTable( {
"aoData": [
{ "sName": "Project" },
{ "sName": "Title" },
{ "sName": "Topic" },
{ "sName": "Subtopic" },
{ "sName": "Published" },
{ "sName": "Release" }
],
"bStateSave": true,
"bProcessing": false,
"bServerSide": true,
"sAjaxSource": "/home/index.cfm/go/bulletin.getBulletins",
"sPaginationType": "full_numbers",
"oLanguage": {
"sSearch": "Search all columns:",
"oPaginate": {
"sFirst": "",
"sLast": "",
"sNext": "",
"sPrevious": ""
}
}
} );

$("thead input").keyup( function () {
/* Filter on the column (the index) of this element */
oTable.fnFilter( this.value, $("thead input").index(this) );
} );
[/code]

Replies

  • brianboltonbrianbolton Posts: 4Questions: 0Answers: 0
    A good nights sleep got me thinking that the DOM positioning feature might allow you to show things more than once.

    This works:
    [code]
    "sDom": '<"top"lfip>rt<"bottom"ip<"clear">',
    [/code]
  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Hi,

    You are absolutely correct in that sDom 'could' be used to do this - and will in future! But I'm afraid that this is not currently implemented. It's on my to do list - and is something I would very much like to include in future versions of DataTables, but until then, the way around it is to write a custom pagination function which injects the required controls into the DOM.

    Regards,
    Allan (wishing there was more hours in the day!)
  • quyenquyen Posts: 4Questions: 0Answers: 0
    Hi Allan,

    Is this possible to hide/disable page control and search?
  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Hi quyen,

    Yes indeed this is possible. To disable the features completely, just use the initialisation feature switch for them: http://datatables.net/usage/features . Or if you want them enabled, but not visible (e.g. so you can use the API functions for them) then just miss that control letter out of sDom.

    Regards,
    Allan
This discussion has been closed.