I want to add a filter to a backend list. But I don't want it to effect the query as such...
The list displays a list of backend users from an
Agent model that extends the
Then I have some columns on my list that are partials...
These partials call some methods on the Agent model. An example of one the partials is below..
<?php foreach ($record->getCommunicationCounts() as $type => $count) : ?> <strong><?=ucfirst($type)?>: </strong><?=$count?><br/> <?php endforeach; ?>
What I want to do is be able to pass some parameters through to these methods based on selections from the list filters. So something like below...
<?php foreach ($record->getCommunicationCounts($this->filters['selectedTimeFrame']) as $type => $count) : ?> <strong><?=ucfirst($type)?>: </strong><?=$count?><br/> <?php endforeach; ?>
So I guess my questions are:-
- Can I add filters to backend list that don't affect the list query?
- Is there a filter type that is a dropdown and only allows one selection?
- Can I access the backend list filter values inside a column partial? And a slightly different question... is there a filter type that's just a dropdown that only allows one selection?
Did you read this?
Yes I have read the docs... Multiple times.
As far as i can tell there's nothing that talks about what I'm trying to do in them unfortunately.
Couldn't find anything either. No dropdown with single select either.
There's one thing that might work, though... you could abuse the list filter scopes by returning the initial query without modifications, BUT save the filter value in the ViewBag component and reuse it in your partial...
1-5 of 5