Search code examples
javascriptjqueryfootable

I want to get the Page Number of Foo Table for Server Side Processing


This is my foo table code I can get when Pagination button is clicked want to get the page number of the button click in java script can anyone please help me with this

$(document).ready(function() {
    $('.footable').footable();
    // $('.footable2').footable();
    $('.footable').footable().bind({
        'footable_paging': function (e) {
            paginateScroll();
        }
    });
});

function paginateScroll() {
    $('html, body').animate({
        scrollTop: $(".footable").offset().top
    }, 100);
    console.log('pagination button clicked'); //remove after test
}

Solution

  • i got it working uses this

    $(document).ready(function () {
        $('.footable').footable();
        $('.footable').footable().bind({
            'footable_paging': function (e) {
                paginateScroll();
            }
        });
    
    
    });
    
    function paginateScroll() {
        $('html, body').animate({
            scrollTop: $(".footable").offset().top
        }, 100);
        $("a").click(function () {
            var number = $(this).text();
          
        });
    }