my goal is duplicate the default shipments grid in another page from the admin panel.

So far I've created my layout xml:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <update handle="styles"/>
        <referenceContainer name="content">
            <uiComponent name="vendor_modulename_shipments_grid"/>

and in the ui_component/vendor_modulename_shipments_grid.xml, I've added this:

<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="provider" xsi:type="string">vendor_modulename_shipments_grid.vendor_modulename_listing_data_source</item>
            <button name="add">
                <url path="*/*/new"/>
                <label translate="true">My new button</label>
    <dataSource name="vendor_modulename_listing_data_source" component="Magento_Ui/js/grid/provider">
            <updateUrl path="mui/index/render"/>
        <dataProvider class="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider" name="vendor_modulename_listing_data_source">
    <columns name="my_column_name">
        <column name="order_increment_id">
                 <label translate="true">Order #</label>

I've didn't want to copy all of the columns from the core file: vendor/magento/module-sales/view/adminhtml/ui_component/sales_order_shipment_grid.xml , so I've added only one : order_increment_id.

So far I am getting this message : Not registered handle vendor_modulename_listing_data_source. Please advice :)


You must define which collection is should be used for your data provider in the di.xml, like this:

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <argument name="collections" xsi:type="array">
            <item name="vendor_modulename_listing_data_source" xsi:type="string">Vendor\Model\Model\ResourceModel\ModelName\Collection</item>

Because in the collection factory that exception throws in case there no collection related to vendor_modulename_listing_data_source (the $name argument) .

Here is code of the collection factory with that exception:


 * Class CollectionPool
class CollectionFactory
     * @var Collection[]
    protected $collections;

     * @var ObjectManagerInterface
    protected $objectManager;

     * @param ObjectManagerInterface $objectManagerInterface
     * @param array $collections
    public function __construct(
        ObjectManagerInterface $objectManagerInterface,
        array $collections = []
    ) {
        $this->collections = $collections;
        $this->objectManager = $objectManagerInterface;

     * Get report collection
     * @param string $requestName
     * @return Collection
     * @throws \Exception
    public function getReport($requestName)
        if (!isset($this->collections[$requestName])) {
            throw new \Exception(sprintf('Not registered handle %s', $requestName));
        $collection = $this->objectManager->create($this->collections[$requestName]);
        if (!$collection instanceof Collection) {
            throw new \Exception(sprintf('%s is not of Collection type.', $requestName));
        return $collection;
  • Cool, Thnx for the quick answer, it works. One more question, if i would like to filter that grid after lets say the order status for the shipment grid. where should I add that filter and how ? Jan 23 '20 at 12:33
  • @AttilaNaghi If I understand you right, you must add a custom filter inside your own collection. If you want to add a column with filter to existing collection (listing) here is my post with example code (but for orders listing). Jan 23 '20 at 13:14
  • thx for helping me out. NO, I don't want another column, I want to filter the shipment collection after the order status . I saw the need to create another post here: magento.stackexchange.com/questions/302026/…. IF you any suggestions ,would be really nice :) thnx Jan 23 '20 at 13:17

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.