Show us some code.
Pagination with Nayjest data grid
Hello , i m using Nayjest data grid , is there some option to generate pagination links from some query in Laravel 5. Pager only show number of pages without links.Do you have some examples to show me how to use it ?
Is there some option to do that ??
Yup, check the Guidelines for posting on Laracasts.com for how to write code here.
Use three backticks like so ```
```
your code goes here
```
This is result from nayjest grid

->setComponents([
(new TotalsRow(['posts_count', 'comments_count'])),
(new TotalsRow(['posts_count', 'comments_count']))
->setFieldOperations([
'posts_count' => TotalsRow::OPERATION_AVG,
'comments_count' => TotalsRow::OPERATION_AVG,
])
,
(new OneCellRow)
->setComponents([
(new HtmlTag)
->setAttributes(['class' => 'pagination'])
->addComponent(
new ShowingRecords)
,
(new HtmlTag)
->setAttributes(['class' => 'pagination'])
->addComponent(
new Pager)
])
])
But I want to show like this picture bellow :

You mean like this http://laravel.com/docs/5.0/pagination
<div class="container">
<?php foreach ($users as $user): ?>
<?php echo $user->name; ?>
<?php endforeach; ?>
</div>
// this is the line you care about
<?php echo $users->render(); ?>
But here $users is some variable, i m using $grid variable where im setting with model :
$grid = new Grid(
(new GridConfig)
->setDataProvider(
new EloquentDataProvider(Contact::get_all_contacts())
)
->setName('contacts_grid')
->setPageSize(5)
->setColumns([ ..
And I ' cant use this : render(); ?> show me this error: Call to a member function render() on a non-object
Look at Nayjest's own documentation, it looks like they mention it right there
https://github.com/Nayjest/Grids
Look for this within the Advanced Example
(new RecordsPerPage)
->setVariants([
50,
100,
1000
])
,
Hi!
@majacirkova, so problem was becouse you used Laravel4 Pager implementation in Laravel 5 project or becouse you tried to render it directly inside tbody tag (browsers will not render some incorrectly placed tags inside tables)? Or there was some another problem?
Hi ! @Nayjest , the problem was that i haven't included this in controller function that i used Nayjest grid implementation:
(new RecordsPerPage)
->setVariants([
50,
100,
1000
])
, ... ```
Please or to participate in this conversation.