1

Hi I use in my project bootgrid I did custom lenght dropdown, evrithing is working apart the table pagination Is there a whay this to be fixed? Here is my code:

 var $table     = $("#data-table");

    $table.bootgrid({
        ajax: true,
        url : 'myfancyurl',
        columnSelection : false,
        templates: {
            //header: "" //Removes default bootgrid header
        },
        css : {
            icon: 'md icon',
            iconColumns: 'md-view-module',
            iconDown: 'md-expand-more',
            iconRefresh: 'md-refresh',
            iconUp: 'md-expand-less'
        },
        labels :{
            all:'',
            loading:''
        },
        requestHandler: function (request) {

            request.searchPhrase = $("#search-phrase").val();
            request.rowCount     = parseInt($('#row-count li.active').text());

            return request;

        }

        }
    });

    $('#row-count li').on('click', function(e){

        $('#row-count li').removeClass('active');
        $(this).addClass('active');

        $('.row-count').text( $(this).text() );

        $table.bootgrid("reload");

    }); 

So when I change lenght on backend side works fine, but the bootgrid doesn't recalc pagination when I pass the rowCount from request. Thanks in advance if someone can help.

Alex
  • 579
  • 5
  • 24

1 Answers1

0

I don't understand your question correctly.

You can add custom rowCount using the rowCount property

 var $table     = $("#data-table");

$table.bootgrid({
    ajax: true,
    url : 'myfancyurl',
    columnSelection : false,
    **rowCount: [10, 25, 33, 50, 66, 100],**
    templates: {
        //header: "" //Removes default bootgrid header
    },...

and then in the backend you can use the request param

rowCount= request.args.get('rowCount', 33)