Smart-Table icon indicating copy to clipboard operation
Smart-Table copied to clipboard

items by page - negative numbers break pagination

Open woodk123 opened this issue 7 years ago • 5 comments

Summary When you set items by page to a negative number the pagination breaks.

Steps to reproduce: Set items by page to a negative number. Set to a positive number. The pagination and number of items displayed does not work any more.

Expected result when set back to positive: The table displays the correct number of items.

This is broken on your demo site http://lorenzofox3.github.io/smart-table-website/

And on the project on my machine my machine I'm using: angular-smart-table 2.1.8 angular 1.5.5

woodk123 avatar Jul 05 '17 15:07 woodk123

why would you put a negative number in the first place...that does not make any sense ?

lorenzofox3 avatar Jul 05 '17 18:07 lorenzofox3

Agreed. However if you accidently click down (on the number modifier) it does break the table as there would be a negative number

woodk123 avatar Jul 05 '17 20:07 woodk123

Hello @woodk123,

which example is broken on the documentation site? I didn't find it. What i found is that only the last example have a pagination where you can do a step back with a button but it don't go further then 1, so it don't break. Normally you build up your pagination likes this or disable the button complete if you are on page 1.

I consider this not as a bug but more like user error.

MrWook avatar Jul 07 '17 05:07 MrWook

Hi @MrWook ,

Thanks for your reply.

Apologies, do a string search for items by page until you find the following section (see the uploaded image) capture Set this to a minus number either manually or by pressing the up down keys on your keyboard. You will notice the moment a negative number is present, the general functionality of the items by page will be broken.

woodk123 avatar Jul 07 '17 09:07 woodk123

Oh yes that's my fault i misread what you said. I thought you meant the pagination by itself not the items by page.

I think you should lock the field to a minimum of value of 0 if you want to use a similar input field so it will never be able to go under 0

MrWook avatar Jul 07 '17 12:07 MrWook