October CMS resources and help articles

Simple and to the point. Optimized by the community.

Get all filtered records by a List Widget

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()
        $listWidget = $this->asExtension('ListController')->listGetWidget();

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

        // do something with $records



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