alfajango / jquery-dynatable

A more-fun, semantic, alternative to datatables
http://www.dynatable.com
Other
2.78k stars 363 forks source link

Get the count of elements after render #297

Open zurmoehle opened 6 years ago

zurmoehle commented 6 years ago

Hello, is there a way to get the count of elements after the table is rendered?

I have a filter installed. This will change the number of displayed items. Since I have a load more built in, I need a function that hides the button if not enough elements are available.

 var dynatable = $('#proflist').dynatable({
      features: {
        paginate: true,
        sort: true,
        pushState: true,
        search: true,
        recordCount: false,
        perPageSelect: true
      },
      inputs: {
        queryEvent: 'blur change keyup'
      }
}).data('dynatable');

This is the load more Button.

$(".loadmore").click(function () {
      perPage = addPerPage + perPage;
      dynatable.paginationPerPage.set(perPage);
      dynatable.process();
      if(perPage > count){
        $(this).addClass("disable");
      }
});