ruby-on-railspaginationbootstrap-table

how to add another same pagination with "bootstrap-table-rails"


I'd like to add another same pagination in a single table. Now a pagination is showed in the bottom of the table but I want another one in the top of the table. I have searched and I couldn't find any but I don't want to install another gem. However, if there is no option with "bootstrap-table-rails" for sure, I would like to get recommendations.

Now, JS code is

$(document).bind("turbolinks:load", function(){
    var pageSize = Cookies.get("pageSize") || 50;
    $("#custom-table").bootstrapTable({pagination:true, pageNumber:Cookies.get("pageNumber"), pageSize:pageSize,  sortName:Cookies.get("sortName"), sortOrder:Cookies.get("sortOrder")});

and html is

table.table.table-striped.table-bordered.table-condensed data={toggle:"table", search:"true", pagination:"true", "page-size"=>50}

Solution

  • I got a solution with data. I don't remember the site but I post the solution I've got.

    in js file:

    $("#custom-table").bootstrapTable({
        pagination:true,
        paginationVAlign:"both",   // added
        pageNumber: Cookies.get("pageNumber"),
        pageSize: pageSize,
        sortName: Cookies.get("sortName"),
        sortOrder: Cookies.get("sortOrder")
    });
    

    in slim file: added "pagination-v-align"=>"both"

    table.table.table-striped.table-bordered.table-condensed data={ 
     toggle:"table", search:"true", pagination:"true", 
     "pagination-v-align"=>"both", "page-size"=>50}