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

The table does not jump to the first page if a user-defined $pageName is used #1646

Closed
lsmedia opened this issue Aug 19, 2024 · 1 comment
Closed

Comments

@lsmedia
Copy link
Contributor

lsmedia commented Aug 19, 2024

Have you searched through other issues to see if your problem is already reported or has been fixed?

No

Did you read the documentation?

No

Have you tried to publish the views?

No, this error is not related to views.

Is there an error in the console?

No

PHP Version

8.2.20 (cli)

PowerGrid

5.10.2

Laravel

10.48.20

Livewire

3.5.6

Alpine JS

3.13.3

Theme

Tailwind 3.x

Describe the bug.

If a user-defined pageName has been specified, the table does not jump to the first page of the search results after the search term has been changed via the search input in the header.

As a result, no search hits and no table navigation are displayed by mistake, and instead only the message that the search did not return any hits.

Only when the page in the called URL (GET parameter) has been removed is the table displayed again in full with navigation.

To Reproduce...

  1. Create a table with Footer::make()->pageName('your-page-name') and Header::make()->showSearchInput() defined in set up
  2. Feed in data until you have more than one page, than navigate to the last page
  3. Use search input in the header to narrow down the amount of data, unless there are fewer pages in the pagination than before
  4. You will see an empty table with no results and no pagination

Extra information

public function updatedSearch(): void
    {
        $this->gotoPage(1);
        
        // possible solution
        // $this->gotoPage(1, data_get($this->setUp, 'footer.pageName'));

        if ($this->hasLazyEnabled) {
            $this->additionalCacheKey = uniqid();

            data_set($this->setUp, 'lazy.items', 0);
        }
    }
@lsmedia lsmedia changed the title Title The table does not jump to the first page if a user-defined $pageName is used Aug 19, 2024
@lsmedia
Copy link
Contributor Author

lsmedia commented Aug 20, 2024

Should be fixed with #1652

@lsmedia lsmedia closed this as completed Aug 20, 2024
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

1 participant