laravel-table icon indicating copy to clipboard operation
laravel-table copied to clipboard

Search by does not refresh the page number

Open chtidom opened this issue 1 year ago • 3 comments

When you display a list and you use the search field above the table the selection is just done on the page displayed while it should do the search on the whole table Needs to add the following method in the class vendor/okipa/laravel-table/src/Livewire/Table.php public function updating($name, $value){ if ($name === "searchBy"){ $this->resetPage(); } }

chtidom avatar Jun 19 '23 11:06 chtidom

I think this sounds very similar to an issue I am faced with at the moment. When you browse through the table results and you go to "page 17" for instance then do a filter, you get a page like what I have attached. Clicking on page 1 at the bottom shows results but it isn't a nice user experience.

I tried the code mentioned by @chtidom above and that seems to resolve the issue for me although I'm not sure what kind of side effects this could cause.

CleanShot 2024-04-22 at 15 07 33

jaymeh avatar Apr 22 '24 14:04 jaymeh

Agreed. I'm seeing the same thing and was just about to post about it :D

HawtDogFlvrWtr avatar May 28 '24 13:05 HawtDogFlvrWtr

This also happens if you select a page number and then change the number of rows to display to something higher than the page number would display. To fix this you need to update the same file with this

    public function changeNumberOfRowsPerPage(int $numberOfRowsPerPage): void
    {
        $this->numberOfRowsPerPage = $numberOfRowsPerPage;
        $this->resetPage();
    }

HawtDogFlvrWtr avatar Jun 06 '24 17:06 HawtDogFlvrWtr