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

Can we add headers on ListView for pagination with range header ? #107

Closed
narigua opened this issue Nov 13, 2014 · 5 comments
Closed

Can we add headers on ListView for pagination with range header ? #107

narigua opened this issue Nov 13, 2014 · 5 comments

Comments

@narigua
Copy link

narigua commented Nov 13, 2014

No description provided.

@fzaninotto
Copy link
Member

I'm not sure I understand what you need. Could you give us an example?

@manuquentin
Copy link
Contributor

You can add headers to a request sent by a ListView with :

new ListView('my-list')
    .headers(function () {
      return {
        'Header1': 'val2'
      };
});

@narigua
Copy link
Author

narigua commented Nov 13, 2014

That's it, thank you !

For my example :

.addView(new ListView('customer-list')
                .title('List of all customers')
                .infinitePagination(false)
                .headers(function () {
                    return {
                      'range': 'items=0-4'
                    };
                })
                .pagination(pagination)
                .addField(new Field('id').label('ID').isEditLink(true))
                .addField(new Field('number').label('Number').type('string').isEditLink(true))
            )

Now i need to get header response for count items and customize pagination function.

@manuquentin
Copy link
Contributor

You can check the doc about pagination(function) & totalItems(function).

@narigua
Copy link
Author

narigua commented Nov 13, 2014

Thank you for your update ;)

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

3 participants