I have a listing ui component and I need to send parameters. this is my listing.xml

<dataSource name="insert_listing_example_data_source" component="Magento_Ui/js/grid/provider">
            <updateUrl path="mui/index/render"/>
            <item name="filter_url_params" xsi:type="array">
                <item name="order_number" xsi:type="string">*</item>
                 <item name="storageConfig" xsi:type="array">
                    <item name="indexField" xsi:type="string">order_number</item>
        <dataProvider class="Vendor\Reports\Ui\Component\Listing\MonitorDataProvider" name="insert_listing_example_data_source">

Then inside Vendor\Reports\Ui\Component\Listing\MonitorDataProvider

I try the following:

 public function getData(){

        $writer = new \Laminas\Log\Writer\Stream(BP . '/var/log/filters.log');
        $logger = new \Laminas\Log\Logger();
        $param = $this->request->getParam('order_number');

        return $this->getCollection()->toArray();

But it's just blank, I'm not getting the filter theres. I need to get the filters on getData() otherwise grid won't update.

I have tried with

 public function addFilter(\Magento\Framework\Api\Filter $filter)

But this method does not updates my getData() even if I filter my collection, so I need to get the parameters directly in getData()


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.