superRaytin / paginationjs

A jQuery plugin to provide simple yet fully customisable pagination.
http://pagination.js.org
MIT License
912 stars 659 forks source link

Is there some using ajax demo? #78

Closed zlongxiang closed 5 years ago

zlongxiang commented 6 years ago

I has seem http://pagination.js.org/, but I don't find some using ajax demo. Could you add some? Thank you !

nikonov91-dev commented 5 years ago

you may use jquery ajax if it helps you

  paginator = () => $('#abc').pagination({
    showGoInput: true,
    showGoButton: true,
    dataSource: (done) => $.ajax({
      url: '/admin/api/modelType/page?pageNumber=2&pageSize=2',
      success: (data) => {
        this.setState({data});
        done(data.content.map((e,i) => i))
      }
    }),
}