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

vadne strankovani? #41

Closed
hrbajda opened this issue Mar 2, 2015 · 1 comment
Closed

vadne strankovani? #41

hrbajda opened this issue Mar 2, 2015 · 1 comment

Comments

@hrbajda
Copy link

hrbajda commented Mar 2, 2015

po af850cd#diff-212f13d14ab66592db3ead0e9e23d060R281 mne skace pri pouziti strankovani vzdy na prvni stranku.
pr:

//$this->paginator->page ==1
//$this->page ==2
                $this->paginator->setItemCount($itemsCount);
                if ($this->paginator->page !== $this->page) {
                    $this->paginator->page = $this->page = 1;
                }
//zde ocekavam $this->paginator->page == $this->page ==2 ale dostavam 1

problem resim zmenou radku https://github.com/nextras/datagrid/blob/master/src/Datagrid.php#L339 na
$this->paginator->page = $this->page? : 1

@racinmat
Copy link
Contributor

taky se mi to stává. A to když vytvořím novou instanci datadridu takto:

public function createComponentUsersDatagrid()
    {
        $grid = new Datagrid($this, 'usersDatagrid');

pokud vytvořím novou instanci takto:

    public function createComponentUsersDatagrid()
    {
        $grid = new Datagrid();

vše je v pořádku.

Jenže předat ten presenter, ve kterém se datagrid vytváří, potřebuji, abych v createComponent metodě přidal do template daagridu vlastní filtry.

racinmat pushed a commit to racinmat/datagrid that referenced this issue Jun 24, 2015
Thanks to onAttached event, you can now put your custom variables to datagrid template and register macros to datagrid template without need to connect datagrid to component tree in constructor, which breaks pagination.
@hrach hrach closed this as completed in 16c41d1 Jul 7, 2015
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