display number of elements in links instead of combobox

display number of elements in links instead of combobox

fredhunterfredhunter Posts: 5Questions: 0Answers: 0
edited July 2011 in General
hi, my question is this.
i have for example 300 elements in a table, what i want to do its display something like this in the footer:

show 20 50 60 all

instead of a combobox selecting the 20, 50 or 60 elements in the table.

i´v been searching but i cant find anything.....some plugin pheraps?

thanks a lot for your help!!!!

Replies

  • tommcktommck Posts: 73Questions: 0Answers: 0
    Check out the pagination plugins here: http://www.datatables.net/plug-ins/pagination

    You might have to write your own, but it's not that hard to do
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    The length change plug-ins is the one you want: http://datatables.net/plug-ins/api#fnLengthChange . With that you can just attach a listener to your links (which you could put in place using a technique like this: http://datatables.net/release-datatables/examples/advanced_init/dom_toolbar.html - or any other way you want to do it), which will call the plug-in function to change the length.

    Allan
  • fredhunterfredhunter Posts: 5Questions: 0Answers: 0
    sorry, im newbie with this, i just dont understand very well, can you explain me with just a little detail maybe.

    any help would really appreciated.

    thanks
  • fredhunterfredhunter Posts: 5Questions: 0Answers: 0
    ok, in my jsp i have this:



    $(document).ready(function() {
    $('#transfer').dataTable( {
    "aaSorting": [[ 2, "asc" ]],
    "sPaginationType": "full_numbers",
    "bPaginate": true,
    "bLengthChange":true,
    "bFilter": true,
    "bSort": true,
    "bInfo": false,

    "bAutoWidth": true } );
    } );
    oTable = $('#transfer').dataTable();
    oTable.fnLengthChange(oTable, 3);
    }


    and i just copied the plugin into my .js

    how can i call fnLengthChange if y click some link in the table?

    am i doing something wrong?
This discussion has been closed.