Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable ui.bootstrap.pagination

I am using ui.bootstrap.pagination

I have a search box in a form on my page. I would like to disable the pagination control while someone is interacting with the search box, then re-enable once they have pressed "Search"

I would like to use the AngularJS form validation

ng-valid
ng-invalid
ng-pristine
ng-dirty

How would I tie the form validation with disabling the pagination?

I could not find out how to make the pagination control appear as disabled and disable input. I'm also using Bootstrap 3.

TIA

like image 960
Josh Petitt Avatar asked Feb 06 '14 17:02

Josh Petitt


1 Answers

The support for directive ngDisabled was added to pagination directive, just an hour ago... ;)

You should be able to block the whole pagination element from outside. Lets say You have variable named blocked in Your scope that indicates when pagination should be blocked. You can then block it like this:

<pagination 
    total-items="totalItems" 
    ng-model="currentPage" 
    ng-change="pageChanged()" 
    ng-disabled="blocked"
></pagination>

Currently to use it, You shoud build newest version from official repo yourself.

like image 58
T.Z. Avatar answered Nov 12 '22 14:11

T.Z.