1

I want to add an inlineEdit feature same as admin customer grid, in related products grid on admin product edit page. For that I extended Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Related class and overridden getGrid() function in following way:

<?php
class DisplayProductLinksAdmin extends \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Related {
    ...
    protected function getGrid($scope): array
    {
        $parent = parent::getGrid($scope);

        if ($scope !== 'related') {
            return $parent;
        }

        $parent['arguments']['data']['config']['editorConfig'] = [
            'clientConfig' => [
                'saveUrl' => $this->urlBuilder->getUrl('custom/index/inlineEdit'),
                'validateBeforeSave' => false
            ],
            'indexField' => 'entity_id',
            'enabled' => true,
            'selectProvider' => 'related_product_listing.related_product_listing.product_columns.ids'
        ];
        $parent['arguments']['data']['config']['childDefaults'] = [
            'fieldAction' => [
                'provider' => 'related_product_listing.related_product_listing.product_columns_editor',
                'target' => 'startEdit',
                'params' => [
                    '0' => '${ $.$data.rowIndex }',
                    '1' => true
                ]
            ]
        ];
        $parent['arguments']['data']['config']['map']['custom_column'] = 'custom_column';
        $parent['children']['record']['children'] = $this->fillMeta();

        return $parent;
    }
    ...
}

I found most of the solutions to add inlineEdit using UI Compoenent, but however vendor/magento/module-catalog/view/adminhtml/ui_component/related_product_listing.xml is not calling in Magento 2.4.5, might be the grid may built from Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Related class. Anyways, please help me to add inlineEdit feature using php class or any other way except UI Component.

Reference image of inlineEdit feature given in admin customer grid: enter image description here

I want to add exactly the above one in related products grid here:

enter image description here

Thanks in anticipation.

0

Your Answer

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