October CMS resources and help articles

Simple and to the point. Optimized by the community.

Get all filtered records by a List Widget

2
by mjauvin, last modified on January 25th, 2021

If you want to take an action on all currently filtered records from your Controller implementing the ListController behavior, add this method to your controller:

    public function onGetFilteredRecords()
    {
        $this->makeLists();
        $listWidget = $this->asExtension('ListController')->listGetWidget();

        $query = $listWidget->prepareQuery();
        $records = $query->get();

        // do something with $records
    }

Discussion

0 comments

We use cookies to measure the performance of this website. Do you want to accept these cookies?