FooTable
FooTable copied to clipboard
data-page-size not working on click of a button
Hi, This is with reference to https://fooplugins.github.io/FooTable/docs/examples/advanced/change-pagesize.html I am trying to change page-size using an event, also tried to reinitialize table still there are only 10 rows showing in the table although the number of entries is more than that. Buttons HTML code is taken from the above-given link. Pasting my code for reference, I would be pleased if someone could help. I am using footable in my AngularJS project. FooTable - Awesome Responsive Tables Version : 2.0.3 js
$('[data-page-size]').on('click', function(e){
e.preventDefault();
var newSize = $(this).data('pageSize');
$("#fooTable").attr("data-page-size",newSize);
console.log($("#fooTable").attr("data-page-size"));
$('#fooTable').append(this.html).trigger('footable_redraw');
});
console.log prints the correct value which is clicked. Please reply ASAP. Thanks Shubham Nandwana
This should change your page size, no need to do anything else.
$('[data-page-size]').on('click', function(e){
e.preventDefault();
var newSize = $(this).data('pageSize');
FooTable.get("#fooTable").pageSize(newSize);
});
This should change your page size, no need to do anything else.
$('[data-page-size]').on('click', function(e){ e.preventDefault(); var newSize = $(this).data('pageSize'); FooTable.get("#fooTable").pageSize(newSize); });
Not working. Error: Uncaught TypeError: footable.get is not a function