Skip to content

[Live Component] Load and scroll with filters #2374

Discussion options

You must be logged in to vote

Hello team,
I managed to find a solution to add filters with load and scroll.
I started from the load and scroll of the following demo
Load and scroll Ux
and I added my filters

I'll share my code with you if it can help others too.

For PHP side

src/Components/Tab/TabCol.php

#[LiveProp(writable: true)]
public string $sortClient = "ASC";

#[LiveAction]
public function sortClients()
{
    $this->sortClient = $this->sortClient === 'ASC' ? 'DESC' : 'ASC';
    $this->filterQuery['c.nomClient'] = $this->sortClient;
    $this->dataToEmit('sortClient' . $this->sortClient, $this->filterQuery);
}

private function dataToEmit(string $nameKey, array $filterQuery)
{
    $this->emitUp('filters', [
    …

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ag-erwan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants