I want to add product grid in Magento 2 admin customer section with a separate tab, that I got completed, but when I select the checkbox values from grid and hit save.

It does not get the values of that grid and checkbox values in get and post action.

I have checked multiple time and tried lot with that but it seems like not working.

Any help on this will be appreciated and a knowledge sharing parts for others.


2 Answers 2


First put block like below code,


<block class="Company\Module\Block\Adminhtml\Product\Edit\Tab\Custom" name="edit.tab.custom"/>
        <block class="Magento\Backend\Block\Widget\Grid\Serializer" name="custom_grid_serializer">
                <argument name="grid_block" xsi:type="string">edit.tab.custom</argument>
                <argument name="callback" xsi:type="string">getSelectedProducts</argument>
                <argument name="input_element_name" xsi:type="string">product_ids</argument>
                <argument name="reload_param_name" xsi:type="string">products_listing</argument>

<block class="Magento\Framework\View\Element\Template" name="grid_scriptjs" template="Company_Module::scriptjs.phtml"/>

Add template like below code,

In view/adminhtml/templates/scriptjs.phtml


    ], function($){     

Here is the module that will add new tab in admin customer and also save selected products to database.

Add product grid in customer admin section

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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