The accepted answer above caused some issues for me, as some column rows were missing after switching the "Columns" class to my custom implementation. Probably a conflict with another extension.
So instead I created a plugin for the "Columns" class and modified the "prepare" method:
di.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Catalog\Ui\Component\Listing\Columns">
<plugin name="vendor_module_plugin_magento_catalog_ui_component_listing_columns" type="Vendor\Module\Plugin\Magento\Catalog\Ui\Component\Listing\Columns" />
</type>
</config>
Columns.php
<?php
namespace Vendor\Module\Plugin\Magento\Catalog\Ui\Component\Listing;
class Columns
{
/**
* @param \Magento\Catalog\Ui\Component\Listing\Columns $subject
* @param \Closure $proceed
* @return \Closure
*/
public function aroundPrepare(\Magento\Catalog\Ui\Component\Listing\Columns $subject, \Closure $proceed)
{
// Try to get the config
$config = @$subject->getData('config');
if ($config) {
// Try to get a specific field that indicates that we are currently processing the product grid
$childDefaultsFieldActionProvider = @$config['childDefaults']['fieldAction']['provider'];
if ($childDefaultsFieldActionProvider === 'product_listing.product_listing.product_columns.actions') {
// Unset the "fieldAction", which removes the "link" on the product grid rows
if (isset($config['childDefaults']['fieldAction'])) {
unset($config['childDefaults']['fieldAction']);
// And save the updated config
$subject->setData('config', (array) $config);
}
}
}
return $proceed();
}
}