Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination using st-pipe #207

Closed
Aeon7 opened this issue Nov 3, 2014 · 2 comments
Closed

Pagination using st-pipe #207

Aeon7 opened this issue Nov 3, 2014 · 2 comments

Comments

@Aeon7
Copy link

Aeon7 commented Nov 3, 2014

Hello, I've been using Smart Table and it has almost all that I need now, I was trying to mix ajax request with pagination but I haven't been able to get it work. Could you help me, please? maybe with an example using the current version of Smart Table.

Thank you.

PS: I've been reviewing this documentation: Client side Pagination, pipe/ajax plugin on http://lorenzofox3.github.io/smart-table-website/

@lorenzofox3
Copy link
Owner

Please refer to the 'submit issue' section fo readme ...

Ajax ? you mean loading pages dynamically using custom pipe function (stPipe) ?

In this case you have to tell smart table about the pages as it can not guess which page is loaded, how many pages you have etc. So set the table state in you pipe function

function customPipe(tableState){
    getMyData().then(function(result){
         //pass from you server the relevant data to set the pagination state 
         tableState.pagination = {
              start:result.start, // start index
              number:result.number, //number of item on a page
              numberOfPages:result.pages //total number of pages
         }
    })
}

@lorenzofox3
Copy link
Owner

have look here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants