FooTable icon indicating copy to clipboard operation
FooTable copied to clipboard

data-page-size not working on click of a button

Open Shubhamnandwana18 opened this issue 6 years ago • 2 comments

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

Shubhamnandwana18 avatar May 07 '18 10:05 Shubhamnandwana18

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);
				});

RambosRide avatar May 13 '18 04:05 RambosRide

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

LeoMoshko avatar Jan 29 '19 17:01 LeoMoshko