Search filter

-2

Good, I have a kind of problem, when I try to filter the users, in itself, it gives me two errors both related to paging.

  • The first is that when we change pages the fields are sent empty, so when changing the page, all the user's data is returned as if we had not applied the filter.

  • The second error is that the ajax renders only the section users, however, it changes the entire page, not only the section I want, that is, it deletes the filter section, I understand that it is the rendersection. p>

Is there any way to specify that you renderize a specific section within a specific div?

    
asked by Carlos Alexander Lemus Mojica 25.07.2017 в 04:54
source

1 answer

2

This case is very common, the "-> paginate ()" that uses eloquent in laravel what generates us are links to the same page but adding a "? page = n", where "n" is the number page, but as I say, is a link and therefore a full page reload and data loss. But I have good news for you, that can be edited, although it is a bit expensive. You must fill in the link with the filter data, so that in the link that creates the page.

{{ $datos->appends('filter'=>'someValue')->links() }}
{{ $datos->fragment('someValue')->links() }}

Likewise, this is frustrating and will take away a lot of time (you're going to reinvent the wheel), so I recommend using libraries already created ( link ) or see a tutorial like link

    
answered by 25.07.2017 / 13:11
source